I'm making a car with a spikes on the front of it, when I start my game. It gives me this error
"16:36:09.250 - Workspace.Minigun Truck.Spike.Damage:3: attempt to index field 'LocalPlayer' (a nil value)"
Code is here.
local Spike = script.Parent
local OnTouched = game.Players.LocalPlayer.Character.Humanoid:TakeDamage(30)
Spike.Touched:Connect(OnTouched)

1 comment
If this doesn't help you can go to this article for more help https://developer.roblox.com/en-us/articles/Creating-Traps-and-Pickups