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

Admin Gui working when i'm using a local script but when I use a normal script it does nothing?

Made a admin gui and I used local scripts, I wanted it so I could do commands on other people. Now it's not working with a normal script.

print("Script Connected")


-- Explode
function ExplodeClick()
	local name = script.Parent.PlayerExplode
	local player = game.Workspace:FindFirstChild(name.Text)
	local humanoid = player:FindFirstChild("Humanoid")
	local exp = Instance.new("Explosion", player.Head)
	exp.Position = player.Head.Position
	exp.BlastRadius = 1
	exp.Parent = player.Head
	
	humanoid.MaxHealth = 100
end
script.Parent.Explode.MouseButton1Click:connect(ExplodeClick)

function GodClick()
	local name = script.Parent.PlayerGod
	local player = game.Workspace:FindFirstChild(name.Text)
	local humanoid = player:FindFirstChild("Humanoid")
	
	humanoid.MaxHealth = math.huge
end
script.Parent.God.MouseButton1Click:connect(GodClick)



function KickClick()
	local name = script.Parent.PlayerKick
	local player = game.Workspace:FindFirstChild(name.Text)
	
	player:remove()
end
script.Parent.Kick.MouseButton1Click:connect(KickClick)


function SpeedClick()
	local name = script.Parent.PlayerSpeed
	local player = game.Workspace:FindFirstChild(name.Text)
	local humanoid = player:FindFirstChild("Humanoid")
	
	
	
	humanoid.WalkSpeed = 100
end
script.Parent.Speed.MouseButton1Click:connect(SpeedClick)


function UnGodClick()
	local name = script.Parent.PlayerUnGod
	local player = game.Workspace:FindFirstChild(name.Text)
	local humanoid = player:FindFirstChild("Humanoid")
	
	humanoid.MaxHealth = 100
end
script.Parent.UnGod.MouseButton1Click:connect(UnGodClick)

3 comments

0

Any errors?

0

Nein

0

Are you using FE ?

1 answer

✓ Accepted answer

Not going to help you until you change this line of code:

player:remove() -- IT GOT DEPRECATED!!! STOP USING IT!!!

Also use :WaitForChild() wherever you can!

2 comments

0

If you are going to say don't use remove (which is true) include that they should use :Destroy() instead.

0

Plus, :remove() can still be used. It just depends on the reason for it. If you want to eventually get it back then use it. If not then use :Destroy()

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