Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Admin script not working (no output either.) Can you help? Why does this happen?

Trying to make an admin. Have I made a mistake? Is it in the wrong place? (StarterGui)

local List = {["Player1"] = true, ["Player1"] = true } -- allowed admins
local Prefix = "/" -- kill/Player1
Target = nil

function FindPlayer(userName)
for _, Player in ipairs (game.Player:GetPlayers()) do
if string.lower(Player.Name) == string.lower(userName) then
return Player
end end end

game.Players.PlayerAdded:connect(fucntion(userJoined)
userJoined.Chatted:connect(function(Message)
Message = string.lower(Message)
if Message:sub(1,5) == "kill"..Prefix and List[userJoined.Name] then // kill/me
if Message:sub(6) == "me" then Target = userJoined
else Target = FindPlayer(Message:sub(6))
end	
if Target and Target.Character then
Target.Character:BreakJoints()
end end	end) end)

3 comments

0

EDIT: Changed from UUUUUUU to Why does this happen?

0

the heck is up with your tabbing and spacing D: D: D: D: D: D: D: D: D: D: D: D:

0

Well... I copied it from the video I was watching. I did think: the heck?

2 answers

✓ Accepted answer

Yes, it is in the completely wrong place. StaterGUI is for Gui's (Text and stuff that appears on your screen).

Put this in ServerScriptService, and if not a;ready in a normal script, do that.

BTW, at the top in variable "list", your supposed to change those player names to who you want to be admins.

2 comments

0

I was watching a tuitoral and it looked like his was in startergui. The guy with the same thing. Thanks.

0

Also, I was testing it in studio.

This script should be located inside ServerScriptService instead otherwise it would not run properly.

This discussion is preserved as it was. New answers, comments, and votes are closed.