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
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.