Run Code
|
Code Wall
|
Users
|
Misc
|
Feedback
|
About
|
Login
|
Theme
|
Privacy
ball script
local Run = game:GetService("RunService") Run.RenderStepped:wait() script.Parent = nil script = nil function HandleBall(ball) if ball:IsA("Model") and ball.Name == "Ball" then else return end local pos = ball:WaitForChild("Position") local vel = ball:WaitForChild("Velocity") local col = ball:WaitForChild("Color") local p = Instance.new("Part") p.Shape = Enum.PartType.Ball p.Size = Vector3.new(1,1,1)*2 p.Anchored = true p.CanCollide = false p.TopSurface = 0 p.BottomSurface = 0 p.CFrame = CFrame.new(pos.Value) p.Name = "Ball" p.Parent = ball local m = Instance.new("SpecialMesh") m.MeshId = 'rbxassetid://57826044' m.TextureId = 'rbxassetid://57825924' m.Scale = Vector3.new(1,1,1)*2 m.Parent = p local s = Instance.new("Part") s.BrickColor = BrickColor.new("Black") s.Transparency = 0.6 s.Size = Vector3.new(1,1,1) s.Anchored = true s.CanCollide = false s.TopSurface = 0 s.BottomSurface = 0 s.Name = "Shadow" s.Parent = ball local m = Instance.new("CylinderMesh") m.Parent = s local a1 = Instance.new("Attachment") a1.Position = Vector3.new(0,0.5,0) a1.Parent = p local a2 = a1:clone() a2.Position = Vector3.new(0,-0.5,0) a2.Parent = p local tr = Instance.new("Trail") tr.Color = ColorSequence.new(col.Value) tr.Lifetime = 0.5 tr.FaceCamera = true tr.Attachment0 = a1 tr.Attachment1 = a2 tr.Parent = p spawn(function() while ball.Parent do local t = tick() Run.RenderStepped:wait() local dt = (tick() - t) p.CFrame = p.CFrame:lerp(CFrame.new(pos.Value + vel.Value*0.05),dt/0.05) s.CFrame = CFrame.new(p.Position.x,0.5,p.Position.z) m.Scale = Vector3.new(p.Position.y*0.5,0.01,p.Position.y*0.5) tr.Color = ColorSequence.new(col.Value) end p:Destroy() end) end for _, ball in pairs(workspace:GetChildren()) do HandleBall(ball) end workspace.ChildAdded:connect(HandleBall)
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
roulette
Truly random numbers (Lua)
фыв
roulette
True every 5
Fixed
hack
Fibonacci in Lua (Inspired)
finding volume of pyramids (for me, but feel free to use)
hij
Please log in to post a comment.