#Int value not run function
35 messages · Page 1 of 1 (latest)
This is in ServerScriptService (Normal Script):
local click = script.Parent.ClickDetector
click.MouseClick:Connect(function(Player)
local ButtonFolder = Player:FindFirstChild("ButtonsStats")
if ButtonFolder then
local ButtonValue = ButtonFolder:FindFirstChild("ButtonClicked")
if ButtonValue and ButtonValue.Value == 0 then
if game.Workspace.File.One.Value == false or game.Workspace.File.Gold.Value == false then
if Player.TeamColor == BrickColor.new("Really red") then
open(Player, ButtonValue)
end
end
end
end
end)
function open(Player, ButtonValue)
script.Parent.Main.Enabled = true
ButtonValue.Value = 1
end
The goal is to make buttons the if you already clicked on one of them you can't click on the other one
thats a localscript?
you're creating those on the client then
aka they wont replicate to the server aka those dont exist for the server
why even have this as a localscript. just use
game.Players.PlayerAdded:Connect(function(plr)
local ButtonsStats = Instance.new("Folder")
ButtonsStats.Name = "ButtonsStats"
ButtonsStats.Parent = plr
local ButtonsClicked = Instance.new("IntValue")
ButtonsClicked.Name = "ButtonsClicked"
ButtonsClicked.Parent = ButtonsStats
end)
Tried
** You are now Level 2! **
Nothing happened with no errors
Is it bcuz the open() ran first before the function open() itself?
Or did I just not know the key mechanics of functions
Players.harel1952.PlayerGui.ScreenGui.Frame.ScrollingFrame.Map1.ResetBuzzers:57: attempt to index nil with 'WaitForChild' - Server - ResetBuzzers:57
@lilac spindleSee
define player
Wdym?
define player...
mouseButton1Click doesn't give you the player
???
@inland canopy game:GetService("Players")
All good now?