Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How do i fix this tool event script properly?

Asked by 5 years ago

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.

0
please Comment if u have questions and more info about the problem doomoxima21 17 — 5y
1
yes, what is script.Parent.Active? Is it a bool value you added in? theking48989987 2147 — 5y
1
because tools don't have an "Active" property theking48989987 2147 — 5y
0
idk i just took this script from the Text button gui *not activated tho but it was mousebutton1 something doomoxima21 17 — 5y
View all comments (11 more)
0
are you getting any errors in the output? theking48989987 2147 — 5y
1
yes, active is not a valid member of the tool doomoxima21 17 — 5y
0
and what is the problem, is it not giving you money? theking48989987 2147 — 5y
0
yeah doomoxima21 17 — 5y
0
can you add the script on the server then? theking48989987 2147 — 5y
0
wut u mean? doomoxima21 17 — 5y
0
Just remove the "script.Parent.Active" thing and it should work, if you want a debounce just make it a variable User#22604 1 — 5y
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 theking48989987 2147 — 5y
0
so wat should i do? doomoxima21 17 — 5y
0
well can you first include the code in your server script so we can see what the problem is? theking48989987 2147 — 5y
0
his error is the tool not having an Active property, pretty sure that code is the issue he has User#22604 1 — 5y

1 answer

Log in to vote
0
Answered by
iladoga 129
5 years ago

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!

Ad

Answer this question