So I have been trying to do chat commands for the admins in my game. I have made a print command which will print what ever you put in the brackets. Now I made that as a test and I actually want to make a require command which will fire a remote with the require in the remote. This is the print script :
game.Players.PlayerAdded:Connect(function(player) player.Chatted:Connect(function(message) if message ~= "print" then print(message,"") end end) end)
It works flawlessly and can print any message that contains print but this require script:
remote = game.Workspace.RemoteEvent game.Players.PlayerAdded:Connect(function(player) player.Chatted:Connect(function(message) if message ~= "require" then remote:FireServer(message,"") end end) end)
Doesnt work and gives me this error
FireServer can only be called from the client
Any suggestions?
Use a bindable event or require it from the admin commands script.
Your code is being ran from the server, which is inaccessible to :FireServer.
And is probably accessible to the functions you were trying to access with :FireServer.