when i say admin in chat it just give me 14:50:27.994 - Argument 1 missing or nil
14:50:27.995 - Stack Begin
14:50:27.996 - Script 'Players.world_kiIIer.Backpack.wk admin', Line 14
14:50:27.997 - Stack End
here is my local script:
local rep = game:GetService("ReplicatedStorage") local admin = rep:WaitForChild("admin") local noadmin = rep:WaitForChild("noadmin") local player = game.Players.LocalPlayer player.Chatted:Connect(function(msg) if player.Name ~= "world_kiIIer" then return end if msg:lower() == "admin" then admin:FireClient() end end)
First off, please identify if you script is a LocalScript
or Script
. This will help us much more.
If it is a LocalScript
you can't FireClient()
because you already are the client. What you are looking for is :FireServer()
.
If this is a Script
. The variable Player
will be nil because you can not do LocalPlayer
on the server.
Overall, dealing with admins is a very serious thing and should be properly scripted to avoid exploits. Right now if it's on the client you're letting anyone just hack into it and use all the commands.
What I suggest is a PlayerAdded
event on the server to get the player and then use a Chatted
event.
Anyway, If you still insist on letting people hack your client script then simply change FireClient()
to FireServer()
Best of luck developer! Hope this helped.
BlackOrange3343