I got this script but I don't know where or how to get the message part into it to say "you now have 20 speed"
tool = game.Lighting:findFirstChild("Run20") --Change 'Item' to the tool/gear you want this button to give. Put the tool/gear with the SAME name in the lighting.
cost = 20 --Change the cost to anything you want. Note: It will subtract the money from the total amount of the player's.
button = script.Parent --Don't do anything to these unless you know what you are doing...
button.BrickColor = BrickColor.Green()
function onTouched(hit)
if button.BrickColor == BrickColor.Green() then
hp = hit.Parent
hu = hp:findFirstChild("Humanoid")
if hu ~= nil then
pc = game.Players:GetPlayerFromCharacter(hp)
c = pc.leaderstats.Points --Change Points to the currency you're using. Currency is the name of the money.
if c.Value >= cost then --If the player has enough money then, the button will turn red and tool/gear will be awarded. Also, the currency will be subtracted.
button.BrickColor = BrickColor.Red()
c.Value = c.Value - cost --If you would like it so that the currency will not be subtracted, delete the "-cost" part.
tool:clone().Parent = pc.Backpack
wait(1)
button.BrickColor = BrickColor.Green()
end
end
end
end
button.Touched:connect(onTouched) |