*Note: I’m pretty new to scripting
You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I’m creating a game where every quarter of a second, a new part is generated, with some random properties. This is merely a game to practice what I have learned in tutorials. I’ve got the generation script working fine, however, I’m currently trying to make a script where only me, the owner can disable/enable the generation of the parts via ClickDetector and a Script in a Part. -
What is the issue? Include screenshots / videos if possible!
The issue is pretty simple: When I initially click on the large part, the generation stops. However, when I click the part to re-enable generation, nothing happens. I’m unable to find any errors. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I’ve tried reviewing the code several times, however, I can’t find anything. I have looked on the Developer Hub, however, I couldn’t find any information to help me. I’ve also tried to write the script differently to no avail. (I’m also trying to figure out a way to delete all the new parts when generation stops, which are instances generated by another script, but I can’t think of any way to do that)
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
Mode = false
if Mode == false then
script.Parent.ClickDetector.MouseClick:Connect(function(player)
if player.Name == "TransportLogistics" then
wait(0.5)
game.Workspace.GenScript.Disabled = true
game.Workspace.Sign.SurfaceGui.TextLabel.Text = "Click to Enable Generation (Owner Only)"
script.Parent.BrickColor = BrickColor.new("Bright red")
Mode = true
end
end)
end
if Mode == true then
script.Parent.ClickDetector.MouseClick:Connect(function(player)
if player.Name == "TransportLogistics" then
wait(0.5)
game.Workspace.GenScript.Disabled = false
game.Workspace.Sign.SurfaceGui.TextLabel.Text = "Click to Disable Generation (Owner Only)"
script.Parent.BrickColor = BrickColor.new("Forest green")
Mode = false
end
end)
end
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.