What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Tried to fix script by my own but i couldn’t fix it
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- This is an example Lua code block
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
Please don’t just paste all your scripts, hoping someone will solve it for you. And it’s better to paste any scripts as text, with lua markup. Also the full error message would be helpful.
That said, at the start of the script you make a variable car, which points to the value of an objectValue in the same location as the script.
Later in the script, we try to look into that car variable to find car.Body, but you say you get the error message ‘attempt to index nil with body’. That means that the car variable is empty (nil).
So most likely, either the object value is not set, and no longer pointing to a car. Or perhaps alternatively, the car is destroyed at some point, after which it can no longer be found.
Oh, lol… Well in the Signal localscript the reference script.Parent.Car.Value should crash, I guess, as that item is not there (looking at explorer). I’m not sure why it doesn’t if all this is put in playerGui.
I’m surprised the other script even works in playerGui, but it seems that:
workspace:FindFirstChild(Player.Name.."'s Car")
Does not actually find any car in workspace. Getting the player reference using parent.parent.parent etc is not the cleanest way, maybe something went wrong there?
Test it by printing Player.Name. Then look if there is a car “(playername)'s Car” in workspace that it should have found. Probably (/certainly) there isn’t, which is why FindFirstChild returns nil, and then trying to access .Body gives this crash.
Edit: In fact if we compare
script.Parent.Parent.Parent.Parent
with your error message and count up, then we see that it is in fact not the player (but the parent of the player). I’ll leave the rest up to you