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

How do you disable a Script forever on roblox studio?

Is there a way you can disable a script forever for script.Disabled = true it works until you reset or rejoin then its enabled again please someone help me keep it disabled even when they reset or rejoin im trying to make it so everytime a player clicks on a textbutton to buy a tool they can never use it again.

Here is the script:

player = script.Parent.Parent.Parent.Parent.Parent.Parent cash = player.leaderstats.Cash price = 100 tool = game.ServerStorage.Tools:FindFirstChild("BlueDuck") infoFrame =script.Parent.Parent

function buy() if cash.Value >= price then player.Backpack.RubberDuck:Destroy() player.StarterGear.RubberDuck:Destroy() cash.Value = cash.Value - price local clone = tool:Clone() clone.Parent = player.Backpack local clone2 = tool:Clone() clone2.Parent = player.StarterGear script.Disabled = true end end script.Parent.MouseButton1Click:Connect(buy)

2 comments

0

Yes

0

When asking question please provide your script so we have something to work with.

2 answers

Howdy!

I'm assuming you placed the Local Script in an service that replicates with the clients, such as the StarterGui. Because it replicates, it is going to copy what is in the Starter Service. So, you just need to edit the script there.

So, let's say you put the Local Script in the StarterGui. You would use a Script to say something similar to game.StarterGui.LocalScript.Disabled = true. Once you do that, it will replicate to all clients as disabled.

##If this helped you out, consider accepting this answer for those sweet, sweet reputation points. If not, comment below and I (or someone else) will help you out.

##Be sure to check out the Roblox API Documentation as well for additional reference.

1 comment

0

I meant to say script not local script my apologise

Im trying to get it so if a player clicks a textbutton to buy a tool the script gets disabled so it cant be used again by that player i have this but idk how to make it disabled forever

player = script.Parent.Parent.Parent.Parent.Parent.Parent cash = player.leaderstats.Cash price = 100 tool = game.ServerStorage.Tools:FindFirstChild("BlueDuck") infoFrame =script.Parent.Parent

function buy() if cash.Value >= price then player.Backpack.RubberDuck:Destroy() player.StarterGear.RubberDuck:Destroy() cash.Value = cash.Value - price local clone = tool:Clone() clone.Parent = player.Backpack local clone2 = tool:Clone() clone2.Parent = player.StarterGear script.Disabled = true end end script.Parent.MouseButton1Click:Connect(buy)

everything works except the script doesnt stay disabled

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