Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onChatted(msg, recipient, speaker)
- local source = string.lower(speaker.Name)
- msg = string.lower(msg)
- local pos1 = script.Parent.Position
- local pos2 = speaker.Character.Head.Position
- dist=(pos1-pos2).magnitude
- dist=dist-math.max(math.max(speaker.Character.Head.Size.x, speaker.Character.Head.Size.z), speaker.Character.Head.Size.y)
- if (dist <= 5 and script.Parent.On.Value == true) then
- local m = Instance.new("Message")
- m.Parent = game.Workspace
- m.Text = msg
- wait(3)
- m:remove()
- 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