Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- plr = owner
- char = plr.Character
- local ArtificialHB = Instance.new("BindableEvent", script)
- ArtificialHB.Name = "Heartbeat"
- script:WaitForChild("Heartbeat")
- local tf = 0
- local allowframeloss = false
- local tossremainder = false
- local lastframe = tick()
- local frame = 1/60
- ArtificialHB:Fire()
- game:GetService("RunService").Heartbeat:connect(function(s, p)
- tf = tf + s
- if tf >= frame then
- if allowframeloss then
- script.Heartbeat:Fire()
- lastframe = tick()
- else
- for i = 1, math.floor(tf / frame) do
- ArtificialHB:Fire()
- end
- lastframe = tick()
- end
- if tossremainder then
- tf = 0
- else
- tf = tf - frame * math.floor(tf / frame)
- end
- end
- end)
- function swait(num)
- if num == 0 or num == nil then
- ArtificialHB.Event:wait()
- else
- for i = 0, num do
- ArtificialHB.Event:wait()
- end
- end
- end
- -------- RAINBOW LEAVE IT TO ME
- local r = 255
- local g = 0
- local b = 0
- coroutine.resume(coroutine.create(function()
- while wait() do
- for i = 0, 254/5 do
- swait()
- g = g + 5
- end
- for i = 0, 254/5 do
- swait()
- r = r - 5
- end
- for i = 0, 254/5 do
- swait()
- b = b + 5
- end
- for i = 0, 254/5 do
- swait()
- g = g - 5
- end
- for i = 0, 254/5 do
- swait()
- r = r + 5
- end
- for i = 0, 254/5 do
- swait()
- b = b - 5
- end
- end
- end))
- while wait() do
- for _,v in pairs (owner.Character:GetDescendants()) do
- if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("UnionOperation") or v:IsA("WedgePart") or v:IsA("TrussPart") then
- v.Material = "ForceField"
- v.Color = Color3.new(r/255, g/255, b/255)
- if v:IsA("UnionOperation") then
- v.UsePartColor = true
- end
- end
- if v:IsA("Accessory") or v:IsA("Hat") then
- for _,v in pairs (v:GetDescendants()) do
- if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("UnionOperation") or v:IsA("WedgePart") or v:IsA("TrussPart") then
- v.Material = "ForceField"
- v.Color = Color3.new(r/255, g/255, b/255)
- for _,v in pairs (v:children()) do
- if v:IsA("Part") then
- v.Material = "ForceField"
- v.Color = Color3.new(r/255, g/255, b/255)
- end
- if v:IsA("UnionOperation") then
- v.UsePartColor = true
- end
- end
- end
- if v:IsA("MeshPart") then
- v.Material = "ForceField"
- v.Color = Color3.new(r/255, g/255, b/255)
- end
- if v:IsA("Tool") then
- for _,v in pairs (v:GetDescendants()) do
- if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("UnionOperation") or v:IsA("WedgePart") or v:IsA("TrussPart") then
- v.Material = "ForceField"
- v.Color = Color3.new(r/255, g/255, b/255)
- if v:IsA("UnionOperation") then
- v.UsePartColor = true
- end
- end
- end
- end
- if v:IsA("Model") then
- for _,v in pairs (v:GetDescendants()) do
- if v:IsA("Part") or v:IsA("MeshPart") or v:IsA("UnionOperation") or v:IsA("WedgePart") or v:IsA("TrussPart") then
- v.Material = "ForceField"
- v.Color = Color3.new(r/255, g/255, b/255)
- end
- end
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement