Hi Developers so i am making door where is textbutton and texlabel wich will allow you to click till the maxclicks value then door will explode i didnt make the explode system yet i am making textbutton system when you click the Clicks value in the board
This is the local script wich is in startergui’s screengui
local deb = false
local function Deletingdoor(value)
if deb ~= true then
deb = true
value.Parent.Parent.Clicks.Value += 1
wait(1)
deb = false
end
end
local function callingsystem(button)
button.Activated:Connect(Deletingdoor(button))
end
for i,v in pairs(workspace.Clickboards:GetChildren()) do
v.SurfaceGui.TextButton.Activated:Connect(callingsystem(v.SurfaceGui.TextButton.Name))
end
isn’t this a built in function, shouldn’t the bracket at the end of this be taken away, but also you should have an end after it with close brackets after the end like ‘end)’
Updated the script some but still not working this is the script now
local deb = false
local function Deletingdoor(value)
if deb ~= true then
deb = true
local a = workspace.Clickboards:FindFirstChild(value)
a.Clicks.Value += 1
wait(1)
deb = false
end
end
workspace.Clickboards.Clickboard1.SurfaceGui.TextButton.Activated:Connect(Deletingdoor(workspace.Clickboards.Clickboard1))
I’d like to point out though, you may not pass parameters using :Connect(). Instead, do this.
local deb = false
workspace.Clickboards.Clickboard1.SurfaceGui.TextButton.Activated:Connect(function()
if deb ~= true then
deb = true
local value = workspace.Clickboards.Clickboard1
local a = workspace.Clickboards:FindFirstChild(value)
a.Clicks.Value += 1
wait(1)
deb = false
end
end)
Works but not that what i wanted i wanted to make automatic system this system wich you gave i will need to copy paste everytime and change things anyways thanks