Alright, so I want a RemoteEvent to be fired whenever a player chats.
Right now, the script only fires once and then if the player chats again it doesn’t fire again.
I’ve tried putting it all locally i.e. moving the playerchatted event into a localscript in StarterGUI, however, this still doesn’t work.
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
game.ReplicatedStorage.Remotes.DialEvent:FireClient(player, msg) -- DialEvent is the remote event
end)
end)
I took this script from the roblox wiki:
https://developer.roblox.com/en-us/api-reference/event/Player/Chatted
This is the script I made for the local end of it. This is a local script in StarterGUI (I wasn’t sure where to put it and StarterGUI has worked for me in the past.).
game.ReplicatedStorage.Remotes.DialEvent.OnClientEvent:Connect(function(player, msg)
if msg == "test" then
tween1:Play()
else
tween2:Play()
end
end)
I cut it down so it isn’t my million and one variables. The script just tweens and object when the event is activated but like I said earlier only works once.
I only really know basic scripting, so I have no idea how I’d go about fixing this.
If you need anymore info feel free to ask me.
Also this is my first topic on here so sorry if I have done anything wrong.