local Car = script.Parent
Car.Touched:Connect(function(hit)
hit.Parent.UrFolder.Race.Value = "Soul"
end)
As I said in my first post, it’s best to check if character, hit.Parent
has an actual Humanoid at first. If the car hits something random, like a wall, it’s going to have an error assuming those folders are in the wall. Also, hit.Parent is the character, not the player.
-- In a Script (server) in Workspace
local car = script.Parent
car.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
-- now that you have the actual player object, do what you want with it
end
end)
2 Likes
Wow thanks you were right. I checked back and tried what you said. Nothing was working because of filtering enabled. So I used a remote event and it worked.
https://i.gyazo.com/4e492c10c171890888b77edab976c97f.mp4
Thanks