I am making a sandbox game where you can make your own obby. I am trying to make a lava script, but when I put in a script with the touched property under an object it affects the game in a way that i don't want. So i thought of making a player or character script that tests if a player touches a Model or part with the name of "Lava." But sadly, I don't know how to do this.
I put this script in StarterCharacterScripts:
player = script.Parent
while true do
for i,v in pairs(player:GetDescendants()) do
v.Touched:connect(function(part)
if part.Name == MainPart and part.Parent == Lava then
player:Destroy()
end
end)
end
end

1 comment
Showing us your code would be great if you want help