So… I want to make this moving platform that moves the player that’s on it, but the player stays on the same location as I mentioned in the title.
Here’s a video with what happens why_is_this_happening.wmv (517.8 KB)
(Sorry for the bad video quality)
so… thats the script I put into the moving part:
while true do
wait()
for i= 1, 50 do
script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0,0,-2)
wait()
end
for i= 1, 50 do
script.Parent.CFrame = script.Parent.CFrame * CFrame.new(0,0,2)
wait()
end
end
Weld each of he parts of the player in contact with the platform to the platform
You could accomplish something like this in the following way:
In a normal, server-side script:
-- Fires this code whenever the platform comes into contact with another part
game.Workspace.Platform.Touched:Connect(function(partTouched)
-- Creates a new WeldConstraint
local wd = Instance.new("WeldConstraint")
-- Parents the constraint to the workspace
wd.Parent = game.Workspace
-- Connects the weld between the platform and the part that touched it
wd.Part0 = game.Workspace.Platform
wd.Part1 = partTouched
end)
It will make the player unable to move. I’m assuming that OP has extra variables to account for in their code (Humanoid.WalkSpeed for instance), but both will move if the part (or player’s) CFrame is updated.