[로블록스 스튜디오] 엘레베이터 파트 만들기!
HTML-код
- Опубликовано: 25 сен 2024
- 스크립트
local speed = 50 --올라가는 스피드
script.Parent.Touched:Connect(function(hit)
local rootpart = hit.Parent:FindFirstChild("HumanoidRootPart") or hit
if not rootpart:FindFirstChild("Elevator") and hit.Parent:FindFirstChild("Humanoid") then
local velocity = Instance.new("BodyVelocity", rootpart)
velocity.Name = "Elevator"
local posi = script.Parent.CFrame.UpVector
local vector = Vector3.new(0,math.huge,0)
if posi.X ~= 0 then
vector = Vector3.new(math.huge, vector.Y, vector.Z)
end
if posi.Z ~= 0 then
vector = Vector3.new(vector.X, vector.Y, math.huge)
end
velocity.MaxForce = vector
velocity.Velocity = script.Parent.CFrame.UpVector * speed
end
end)
script.Parent.TouchEnded:Connect(function(hit)
local rootpart = hit.Parent:FindFirstChild("HumanoidRootPart") or hit
if rootpart:FindFirstChild("Elevator") and hit.Parent:FindFirstChild("Humanoid") then
for i, v in pairs(rootpart:GetChildren()) do
if v.ClassName == "BodyVelocity" then
v:Destroy()
end
end
end
end)
마지막 자막 : 1.5분쯤에 자막이 가려졌어요~ 내용은 설명창 스크립트 복붙 하라는 이야기입니다.
1빠
3빠
2빠
너무 느려요,,
스피드를 올리세요...