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

My TextbuttonDisabler script works but gets Visible after reset?

I want to add a localscript to a button that makes it dissapear after clicked on it and if the player resets its still not visible

LocalScript=

local player = game.Players.LocalPlayer
local leaderboard = player:WaitForChild("leaderstats")
local button = script.Parent
local price = button:WaitForChild("Price")
local item = button:WaitForChild("ItemName")
local rs = game:GetService("ReplicatedStorage")

button.MouseButton1Click:connect(function()
	if leaderboard.Money.Value >= price.Value then -- Change "Coins" to your currency name...
		leaderboard.Money.Value = leaderboard.Money.Value - price.Value
		local item = rs:WaitForChild(item.Value)
		item:Clone().Parent = player.StarterGear
		item:Clone().Parent = player.Backpack
		button.LocalScript2.Disabled = false
	end
end)

while wait() do
	button.Text = item.Value.." - "..price.Value
end

LocalScript2=

script.Parent.Visible = false


while true do 
	script.Parent.MouseButton1Click:connect(lol)
		
	end


local function lol(part)
	local parent = part.Parent
	if parent.Humanoid.Health = 0 then
		script.Parent.Visible = false
	end
	
end

Can someone fix the localscript

1 answer

✓ Accepted answer

You can set the property of ResetOnSpawn to false. Thats it.

4 comments

0

oh

0

and wheres the property?

0

Ah its at ScreenGui

0

YAY THANK YOU!! ;DD

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