how to make a falling platform that respawns
debris?
please explain what you want the part to do first
i know its falling but where?
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
If I understood you right, this is a very basic way to make a falling platform that respawns
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
how would i make the platform actully spawn into the game?
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.
oh ok but were does it spawn it
Anywhere you want just change the xyz position
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.
ok so i put it some were on the map and then put it into replicated storage and it should work?
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.
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)
robloxapp-20220321-1547455.wmv (91.3 KB)
whats that for is it a file?
30
wmv stands for windows media video
basically video but downloadable
i was too lazy to open up obs
oh ok i didnt know that thx
30
im about to pm u
sry i meant a platform that falls when a player touches it should have said that
do you know how i would make it so that the platform only falls when a player touches it