|
| 12 Jun 2013 02:38 PM |
--I'm making a click regen script where the model is placed inside the player that clicked (yes I suck at it) --They pay cash to spawn the car. Doesn't work and no outputs --Help? Script so far:
object = game.Lighting.Ferrari458 if (object ~= nil) and (object ~= game.Lighting) then
model = object
while true do wait(.01) backup = model:clone()
function onClicked(Clicked) model = backup:clone() model.Parent = Clicked.findFirstChild("Humanoid") if Clicked.findFirstChild("Humanoid") and Clicked:findFirstChild("leaderstats").Money.Value >= 10000 then Clicked:findFirstChild("leaderstats").Money.Value = Clicked:findFirstChild("leaderstats").Money.Value - 10000 model:MakeJoints() end end end end
script.Parent.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2013 02:42 PM |
| Instead of Clicked:findFirstChild("leaderstats") would it be player:findFistChild("leaderstats") or does that have a different function? |
|
|
| Report Abuse |
|
|
Usering
|
  |
| Joined: 18 Aug 2012 |
| Total Posts: 10281 |
|
|
| 12 Jun 2013 02:44 PM |
| You defined your player as Clicked, also FindFirstChild is a method, not a property. Clicked:FindFirstChild("Humanoid") |
|
|
| Report Abuse |
|
|
|
| 12 Jun 2013 02:48 PM |
| yea my bad. Still doesn't want to work though |
|
|
| Report Abuse |
|
|
Usering
|
  |
| Joined: 18 Aug 2012 |
| Total Posts: 10281 |
|
|
| 12 Jun 2013 02:53 PM |
| Since I'm somewhat nice, I'll rewrite it for you. Just give me a minute or two... |
|
|
| Report Abuse |
|
|
| |
|
Usering
|
  |
| Joined: 18 Aug 2012 |
| Total Posts: 10281 |
|
|
| 12 Jun 2013 02:58 PM |
object = game.Lighting.Ferrari458
script.Parent.ClickDetector.MouseClick:connect(function(player) if player and player.Character and object and player.leaderstats and player.leaderstats.Money.Value >= 10000 then player.leaderstats.Money.Value = player.leaderstats.Money.Value - 10000 clone = object:Clone() clone.Parent = player.Character.Humanoid clone:MakeJoints() end end) |
|
|
| Report Abuse |
|
|
Usering
|
  |
| Joined: 18 Aug 2012 |
| Total Posts: 10281 |
|
|
| 12 Jun 2013 02:58 PM |
| Keep in mind I don't really know what you want to do in this script, but try that. |
|
|
| Report Abuse |
|
|
| |
|
kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
|
| 12 Jun 2013 02:59 PM |
| Why do you need to check is a humanoid clicked it? Only Players can click it anyway. Remove that and the and after it. |
|
|
| Report Abuse |
|
|