Mr_3242

Universal infjump (kinda)

Mar 4th, 2026
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.68 KB | Gaming | 0 0
  1. -- LocalScript inside StarterPlayerScripts
  2.  
  3. local player = game.Players.LocalPlayer
  4. local character = player.Character or player.CharacterAdded:Wait()
  5. local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
  6.  
  7. -- Create the part under the player
  8. local followPart = Instance.new("Part")
  9. followPart.Size = Vector3.new(4, 1, 4) -- size of the part
  10. followPart.Anchored = true
  11. followPart.CanCollide = true
  12. followPart.Material = Enum.Material.Neon
  13. followPart.Color = Color3.fromRGB(0, 255, 0)
  14. followPart.Transparency = 0.5
  15. followPart.Parent = workspace
  16.  
  17. -- Function to update part's position under the player
  18. local function updatePart()
  19.     if character and humanoidRootPart then
  20.         followPart.Position = humanoidRootPart.Position - Vector3.new(0, humanoidRootPart.Size.Y/2 + followPart.Size.Y/2, 0)
  21.     end
  22. end
  23.  
  24. -- Toggle collision switch
  25. local toggle = true
  26.  
  27. -- Create a GUI button for toggle
  28. local screenGui = Instance.new("ScreenGui")
  29. screenGui.Parent = player:WaitForChild("PlayerGui")
  30.  
  31. local toggleButton = Instance.new("TextButton")
  32. toggleButton.Size = UDim2.new(0, 100, 0, 50)
  33. toggleButton.Position = UDim2.new(1, -110, 0.5, -25) -- right side
  34. toggleButton.Text = "Toggle Collision"
  35. toggleButton.BackgroundColor3 = Color3.fromRGB(255, 100, 100)
  36. toggleButton.TextColor3 = Color3.new(1,1,1)
  37. toggleButton.Parent = screenGui
  38.  
  39. toggleButton.MouseButton1Click:Connect(function()
  40.     toggle = not toggle
  41.     followPart.CanCollide = toggle
  42.     if toggle then
  43.         followPart.Color = Color3.fromRGB(0,255,0)
  44.     else
  45.         followPart.Color = Color3.fromRGB(255,0,0)
  46.     end
  47. end)
  48.  
  49. -- Update loop
  50. game:GetService("RunService").RenderStepped:Connect(updatePart)
Tags: delta
Advertisement
Add Comment
Please, Sign In to add comment