Rising Lava Gamemode

I’m trying to make gamemodes for my game, on gamemode is rising lava, I have looked up how to do rising lava kill you but I cant figure it out, I have the lava going up my a tweens but that all I have
.

Thanks in advance!

2 Likes

Use a touched event.

local part = workspace.somethingblabla -- Create the reference
part.Touched:Connect(function(other)
    local humanoid = other.Parent:FindFirstChildWhichIsA("Humanoid")
    if humanoid then -- If a player was touched
        humanoid.Health = 0 -- Kills the player
    end
end)

The part has no humanoid that’s the problem, I have to make the character invisible

Can you clarify a bit more about what you’re trying to do?

All players have a humanoid, the code gets the player’s humanoid.

I can send you the game, that may explain what I’m talking about

Tell each client to start rising lava with a remote event, and then use a Touched event on the server to detect if the player is touching the lava.

Well I increase lava by the server, and I have used a touched event but it didnt do anything

Rising the lava on the server is okay, but it might lag for all the clients, especially if your tweening it. But that doesn’t explain why the touched event wouldn’t be working. Can you show some code of how you handle the lava and lava touches?

script.Parent.Touched:Connect(function(Part)

if Part:FindFirstChild(“Cube”) then

Part.Cube.Transparency = 1

end

end)

1 Like

I don’t get it… What is your problem here exactly?

1 Like

So I’m trying to make a lava gamemode, when the lava raises and hit’s a player the player turns invisible. But when a player touches the lava the touched event dose not fire

1 Like

So you want the connection to fire and not fire at the same time on the same situation?

Well not the touched event gets fired when something touches it

so do you want to make if lava touches a player it makes him invisible

script.Parent.Touched:Connect(function(Plr)
	if Plr.Parent:FindFirstChildOfClass("Humanoid") then
		for i,v in pairs(Plr.Parent:GetDescendants()) do
			if v:IsA("BasePart") then
				v.Transparency = 1
			end
		end
	end
end)
1 Like

This wouldn’t work because the Touched events only works with baseparts and what you are trying to do here is a model.

1 Like

its not lol
ur funny man it finding humanoid

1 Like

heres an updated script that hides the face

script.Parent.Touched:Connect(function(Plr)
	if Plr.Parent:FindFirstChildOfClass("Humanoid") then
		for i,v in pairs(Plr.Parent:GetDescendants()) do
			if v:IsA("BasePart") or v:IsA("Decal") then
				v.Transparency = 1
			end
		end
	end
end)
1 Like

and a little bit off topic is there a way to fix this

1 Like

well its not detecting the player touching the lava so dose not fire the function

1 Like

why the heck you need the function for?

1 Like