So when a player clicks on this text button, they get a purple fire in their torso.
local Player = game.Players.LocalPlayer
local Torso = Player.Character.Torso
debounce = true
function onClicked()
if Player.leaderstats.NeonBux.Value>=10 and debounce == true then
Player.leaderstats.NeonBux.Value=Player.leaderstats.NeonBux.Value-10
local Fire = script.Parent.Fire:Clone() --both localscript and fire is inside text button
Fire.Parent = Torso
debounce = false
wait(5)
debounce = true
end
end
script.Parent.MouseButton1Down:connect(onClicked)

7 comments
LocalScript or ServerScript?
LocalScript as mentioned
Overlooked that, sorry. Any errors in output or developer console?
There are errors about decals failing to load, but nothing about the code itself
Wait at the top it says in red "LocalPlayer is a not a valid member of Player"?
Nvm I fixed that error, but the script still doesn't work in Server mode
You need to have the script wait for the torso to load in,