How to make a falling platform that falls when a player steps on it and respawns

how to make a falling platform that respawns

2 Likes

debris?

please explain what you want the part to do first
i know its falling but where?

1 Like

You could do something like this :

local platform  = game.ReplicatedStorage.Platform


while true do
	local clone = platform:clone()
	if not game.Workspace:FindFirstChild(platform.Name) then
		clone.Parent = workspace
		clone.Anchored = false
		task.wait(2)
		clone:Destroy()
	end
	task.wait()
end

image

1 Like

If I understood you right, this is a very basic way to make a falling platform that respawns

1 Like

make a normal script and put the normal script in serverscriptservices
put a part named platform in replicated storage

Script:

local rep = game:GetService("ReplicatedStorage")
local platform = rep:WaitForChild("Platform")--the platform is in replicatedstorage
platform.Parent = rep
platform.Position = Vector3.new(-60.4, 21.418, 77.084) --forced the platform position here
local tween = game:GetService("TweenService")
local debris = game:GetService("Debris")

while wait(2.8) do --every 2.8 seconds it does all of the things below
	local clone = platform:Clone()

	local tweeninfo = TweenInfo.new(1.5)--how long its gonna last for
	
	local ts = tween:Create(clone,tweeninfo,{Position = Vector3.new(-60.4, 2.454, 77.084)})--tweening position
	
	local tweeninfo2 = TweenInfo.new(0.5)
	
	local ts2 = tween:Create(clone,tweeninfo2,{Transparency = 1})
	
	debris:AddItem(clone,2.1)--this makes the part automatically destroy after 2.1 seconds
	
	clone.Parent = workspace--parenting the clone to workspace 
	ts:Play()
	wait(0.8) 
	ts2:Play()

	end
2 Likes

how would i make the platform actully spawn into the game?

1 Like

Have a look at these lines :

local platform = game.ReplicatedStorage.Platform
local clone = platform:clone()
	if not game.Workspace:FindFirstChild(platform.Name) then
		clone.Parent = workspace

We here clone the platform that is currently in RS, and we check if that block hasnt spawned yet in workspace, if it really hasnt, we then parent the clone to workspace and it spawns.

1 Like

oh ok but were does it spawn it

Anywhere you want just change the xyz position

1 Like

Depends. If you copy the code I did, it’d spawn it at the point the platform in RS is at.

To change the position, you could use various ways to move the model/change his pos.

3 Likes

ok so i put it some were on the map and then put it into replicated storage and it should work?

2 Likes

Only if the pos of that model will spawn within the baseplate zone, meaning - it’d spawn on it ,and not fall into the void.

3 Likes

yes
think of it as this way
if the part is in workspace the transparency is 0
and when u put the part in replicated storage the transparency is 1
(it doesnt change the transparency this was just an example)

2 Likes

robloxapp-20220321-1547455.wmv (91.3 KB)

2 Likes

whats that for is it a file?
30

2 Likes

wmv stands for windows media video

basically video but downloadable
i was too lazy to open up obs

2 Likes

oh ok i didnt know that thx
30

2 Likes

im about to pm u

1 Like

sry i meant a platform that falls when a player touches it should have said that

2 Likes

do you know how i would make it so that the platform only falls when a player touches it

3 Likes