Advertisement
DrawingJhon

Untitled

Jun 23rd, 2020
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. local ON = false
  2. workspace.Part1.Touched:Connect(function(hit)
  3.     local humRootPart = hit.Parent:findFirstChild("HumanoidRootPart")
  4.     if humRootPart ~= nil and ON == true then
  5.         local en = humRootPart.Orientation
  6.         --humRootPart.CFrame = workspace:findFirstChild("Part2").CFrame * CFrame.new(Vector3.new(0, 2, 0)) * CFrame.Angles(math.rad(en.X),math.rad(en.Y),math.rad(en.Z))
  7.         humRootPart.Position = workspace:findFirstChild("Part2").Position + Vector3.new(0, 3, 0)
  8.     end
  9. end)
  10. local TM = workspace:findFirstChild("TouchMe")
  11. local cd = Instance.new("ClickDetector", TM)
  12. cd.MouseClick:Connect(function()
  13.     if ON == false then
  14.         TM.BrickColor = BrickColor.new("Lime green")
  15.         ON = true
  16.     else
  17.         TM.BrickColor = BrickColor.new("Really red")
  18.         ON = false
  19.     end
  20. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement