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

How do i fix this tool event script properly?

Well this is the first script of the tool event. how do i fix this? What i am trying to make is when a tool is clicked, it gives me money... but i have this problem that i can do it on button gui, i want it to be on a tool. so how do i fix or re-script this?

script.Parent.Activated:connect(function()
	workspace.Events.AddSpins:FireServer()
	script.Parent.Active = false
	wait(.2)
	script.Parent.Active = true
end)

please Explain it to me and add me in roblox for more info.

15 comments

0

please Comment if u have questions and more info about the problem

1

yes, what is script.Parent.Active? Is it a bool value you added in?

1

because tools don't have an "Active" property

0

idk i just took this script from the Text button gui *not activated tho but it was mousebutton1 something

0

are you getting any errors in the output?

1

yes, active is not a valid member of the tool

0

and what is the problem, is it not giving you money?

0

yeah

0

can you add the script on the server then?

0

wut u mean?

0

Just remove the "script.Parent.Active" thing and it should work, if you want a debounce just make it a variable

0

Like the code on the server script that listens to the remote event, and gewhrreben, I don't think so, it fires the remote event before those lines of code run

0

so wat should i do?

0

well can you first include the code in your server script so we can see what the problem is?

0

his error is the tool not having an Active property, pretty sure that code is the issue he has

1 answer

✓ Accepted answer

First of all your probably going to get an error because "Active" is not a valid property of a tool. And you must have a server script that receives the remote event and gives them money. If the money is a Number value of an int value then you can do something like this.

--SERVER SCRIPT

game.ReplicatedStorage.AddSpins.OnServerEvent:connect(function(player)
	plr.Money.Value = plr.Money.Value +10
end)

Make sure "plr.Money" is your money value and replace 10 with the amount of money you want to give them.

Thanks for asking and you can contact me for more info!

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