Mezur
|
  |
| Joined: 29 Jun 2015 |
| Total Posts: 3040 |
|
|
| 13 Dec 2015 08:24 PM |
How can I make it so that once you click the part and receive the gold, the part disappears then comes back in 5 seconds?
function onClicked(hit) local h = hit.Parent:findFirstChild("Humanoid") if h == nil then return end local Player = game.Players:GetPlayerFromCharacter(hit.Parent) if (Player ~=nil) then Player.leaderstats.Gold.Value = Player.leaderstats.Gold.Value + 100 end end script.Parent.Touched:connect(onClicked) |
|
|
| Report Abuse |
|
|
Mezur
|
  |
| Joined: 29 Jun 2015 |
| Total Posts: 3040 |
|
| |
|
AuroJosh
|
  |
| Joined: 04 Oct 2015 |
| Total Posts: 484 |
|
|
| 13 Dec 2015 09:10 PM |
MAKE SURE THERE IS A CLICK DETECTOR IN THE PART
Script:
brick = script.Parent:Clone()
function onClicked(plr) plr.leaderstats.Gold.Value = plr.leaderstats.Gold.Value + 100 script.Parent:Destroy() wait(5) brick.Parent = game.Workspace end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
#code print("Who is this you speak of?".."Dis is AuroJosh!") |
|
|
| Report Abuse |
|
|