Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 7 years ago
Edited 7 years ago

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)
0
EDIT: Changed from UUUUUUU to Why does this happen? Magnetic_Aviator 21 — 7y
0
the heck is up with your tabbing and spacing D: D: D: D: D: D: D: D: D: D: D: D: Perci1 4988 — 7y
0
Well... I copied it from the video I was watching. I did think: the heck? Magnetic_Aviator 21 — 7y

2 answers

Log in to vote
0
Answered by 7 years ago

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.

0
I was watching a tuitoral and it looked like his was in startergui. The guy with the same thing. Thanks. Magnetic_Aviator 21 — 7y
0
Also, I was testing it in studio. Magnetic_Aviator 21 — 7y
Ad
Log in to vote
0
Answered by 7 years ago
Edited 7 years ago

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

Answer this question