Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- plr = game.Players.LocalPlayer
- root = plr.Character.HumanoidRootPart
- hum = plr.Character.Humanoid
- rock = workspace.Boulder
- mouse = plr:GetMouse()
- on = true
- mouse.KeyDown:Connect(function(key)
- if key == 'f' then
- on = not on
- end
- end)
- local params = RaycastParams.new()
- params.FilterType = Enum.RaycastFilterType.Exclude
- params.FilterDescendantsInstances = {plr.Character}
- bp = Instance.new('BodyPosition')
- bp.MaxForce = Vector3.new(999999,999999,999999)
- bp.P = 10000
- while hum.Health > 0 do
- if on then
- local spawncf = CFrame.new(rock.Position) * CFrame.Angles(0,math.pi/2,0) * CFrame.new(0,0,7)
- local landing = workspace:Raycast(spawncf.p, spawncf.UpVector*-10, params)
- if landing and landing.Position then
- root.CFrame = spawncf * CFrame.new(0, landing.Position.Y - spawncf.p.Y + 3.5, 0)
- end
- --hum:MoveTo(root.Position + (rock.Position-root.Position).Unit * 100)
- bp.Parent = root
- bp.Position = root.Position + (rock.Position-root.Position).Unit*30
- else
- bp.Parent = nil
- hum:MoveTo(root.Position)
- end
- wait(.2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement