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.
1 comment
You shouldn't use remotes that can cause server-damage. Just saying.