I created a car with a brick. The brick is grouped with the car to make a model. In the brick I have a ClickDetector and the following script.
location = script.Parent.Parent.Parent regen = script.Parent.Parent save = regen:clone() function onClicked(hit) if hit.Parent.Humanoid~= nil then local player = game.Players:GetPlayerFromCharacter(hit.Parent) cash = player:WaitForChild("leaderstats").Cash if cash.Value >= 100 then cash.Value = cash.Value - 100 back = save:clone() wait(1) back.Parent = location back:MakeJoints() else print("Not enough Cash") end end end script.Parent.Touched:connect(onClicked) --might be issue
I am not sure how to read the output bar, but I may think the issue is with the last part of the script. If you could help, that would be great!
This is the whole output bar, if you would like to see it:
21:54:11.675 - Auto-Saving...
21:54:11.726 - No active sound driver detected
21:54:12.348 - httpGet http://assetgame.roblox.com/Asset/?id=160627755&serverplaceid=0&clientinsert=0 failed. Trying again. Error: HTTP 403 (HTTP/1.1 403 Asset is not trusted for this place). Elapsed time: 0.0820705
21:54:12.368 - Content failed for http://assetgame.roblox.com/Asset/?id=160627755&serverplaceid=0&clientinsert=0 because HTTP 403 (HTTP/1.1 403 Asset is not trusted for this place)
21:54:12.369 - Content failed because HTTP 403 (HTTP/1.1 403 Asset is not trusted for this place) Go! system update failed! Is the creator of this game in possesion of the model? Model ID: 160627755
You are indeed correct. The issue is in line 23. Touched
is an event of Part
. If someone touches a Part, Touched is triggered. As i understood, your trying to detect rather a player has Clicked
the part, right? So change line 23 to this:
script.Parent.MouseClick:connect(onClicked)