Here’s a snippet of my script which uses the player.chatted function, it’s an admin script. Whenever the player chat it’s meant to at least print that they chatted, but it doesn’t and the commands don’t work.
game.Players.PlayerAdded:Connect(function(player) -- When a player says something
player.Chatted:connect(function(msg)
print('chat detected')
local command = string.split(msg, ' ')
local cmd = table.remove(command, 1)
local arg1 = table.remove(command, 1)
if cmd == '!kick' then-- and Check(player.Name) >= mod and Check(Fill(arg1)) <= Check(player.Name) then
There’s an appropriate “end” structure at the end of the script and there’s no output response.
Ok, I’ve replicated your situation, “chat detected” prints for me. I think the problem lies outside of the code editor, try checking all of the properties of the Script and of all of its ancestors. Check stuff like:
I think good ol’ roblox is acting up again, since this Covid-19 pandemic I’ve had many scripts break out of nowhere and then fix theirselves, I’ll try to boot up the studio later and it might work. I have literally the same script opened on another place and it works just fine. If it still doesn’t work I’ll keep you guys updated.
Alright, I did more testing and apparently the PlayerAdded function is the problem, I used the print function to print whenever a player joins and it didn’t print. I also used the same print command on my datastore script right after PlayerAdded and it worked, I have no clue on what can be the problem, I tried ChildAdded too but no difference.
That’ll be a big problem to work around with considering I know for sure it works the way it does now, if I use remote events I’ll have to add new security layers to the script and it may even be bypassed by exploiters at some point, I wouldn’t personally trust the client to hold such power, even if I do verification methods hackers always find a way around it.
Basing on what you said, the top of your script runs but the PlayerAdded handler does not. Perhaps you have an infinite loop like a while loop in between?
Okay, can you give me any example where I, as a white hat hacker, can bypass a server check?
I cannot think of one. Sacrificing performance for security is not so much as a sacrifice, it’s a disaster.
Normally, a player will not join your game, thinking ‘Is this secure?’, instead, he will think ‘Why is this lagging so much?’ or ‘Why is it taking so long?’
You may not see it’s impact (unless you debug), until you add more and more performance intensive systems.
However. it’s only my opinion. Do what you think is best. Good luck!
If you fire a RemoteEvent with the client, the server can see which player fired it. Because of this, you would only need to check wheter the client that fired the event is an admin or not. It isn’t that hard to implement, either.
Yeah, I think I’ll do that, I had some bad experiences with using remote events to make admin command scripts but that’s probably because I didn’t had good scripting skills.
I fixed it now, before the PlayerAdded function there were a few other functions like complete names, tool names, item names, etc. Those were corrently enclosed but for some reason they were clogging the script, now that they’re after the PlayerAdded function it works perfectly fine.