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

I need help with a admin bar gui the thing am doing is not working?

Hi I want to make a admin bar I am using this script

local TEXTBOX = script.Parent.Parent.TextBox


script.Parent.MouseButton1Click:connect(function()

if TEXTBOX.Text == nuke then
	
	game.ReplicatedStorage.RemoteEvents["nuke"]:FireServer("Admin")
	
end

end)

the events work when I called them with command bar I have 1 textbox and 1 text button

1 comment

0

You shouldn't use remotes that can cause server-damage. Just saying.

1 answer

Comparing wrong data types will make the conditional in a if-statement appear false.

You're trying to compare TEXTBOX.Text, which is a string value, to nuke, which is a non-defined variable or nil value.

Either define nuke as a variable with some string value or convert it to a string if that's how you want it.

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvents = ReplicatedStorage:WaitForChild("RemoteEvents")

local nukeEvent = RemoteEvents:WaitForChild("nuke")

local textbox = script.Parent.Parent.TextBox

script.Parent.MouseButton1Click:Connect(function()
	if textbox.Text == "nuke" then
		nukeEvent:FireServer("Admin")
	end
end)

Please reply if this is what you were looking for as your explanation to the issue is a bit limiting.

3 comments

0

yes thank you so much

0

wait it does not work

0

Re-edited to prevent any local loading bugs. Any errors in output?

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