Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- waittime = 5--Change this to the time that the overhead message will stay (Leave it to a low number because if someone chats a lot, you won't be able to read it)
- function onChatted(msg,recipient,speaker)
- if toWho(msg,speaker)~=false then
- players = game.Players:getChildren()
- for i=1, #players do
- --if players[i].SuperSafeChat==false then --SuperSafe is ON
- if(players[i].Name==glue[2].Name)then
- local char = players[i].Character
- if char:findFirstChild("chatMsg")~=nil then
- char:findFirstChild("chatMsg").Parent = nil
- end --Looks less confusing with text here...
- local model = Instance.new("Model")
- local model2 = Instance.new("Model")
- local brick = Instance.new("Part")
- local humanoid = Instance.new("Humanoid")
- local weld = Instance.new("Weld")
- model2.Name = "chatMsg"
- model2.Parent = char
- model.Parent = model2
- brick.Parent = model
- brick.Position = char.Head.Position + Vector3.new(0,1,0)
- brick.Name = "Head"
- brick.Transparency = .98
- brick.formFactor = "Plate"
- brick.Size = Vector3.new(1,.4,1)
- brick.CanCollide = false
- brick.Locked = true
- humanoid.MaxHealth = 0
- humanoid.Parent = model
- weld.Parent = char.Head
- weld.Part1 = char.Head
- weld.Part0 = brick
- weld.C1 = CFrame.new(0,2,0)
- model.Name = (""..speaker.Name..": "..glue[1].."")
- wait(waittime)
- model2:Remove()
- end
- end
- end
- end
- function toWho(msg,speaker)
- if (string.sub(msg,1,2) == "@/") then
- for pie = 3,50 do
- if string.sub(msg,pie,pie) == "/" then
- danumber = pie - 1
- break
- end
- end
- ick = string.sub(msg,3,danumber)
- ick2 = string.sub(msg,danumber + 2)
- char1 = nil
- local c = game.Players:GetChildren()
- for i=1,#c do
- h = c[i]
- if string.find(string.lower(h.Name),string.lower(ick)) == 1 then
- if h.className == "Player" then
- char1 = h
- message = ick2
- glue={[1]=message,[2]=char1}
- return glue
- end
- else return false
- end
- end
- else
- return false
- end
- end
- function onPlayerEntered(newPlayer) newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
- end
- game.Players.ChildAdded:connect(onPlayerEntered)
Add Comment
Please, Sign In to add comment