Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ZCube()
- local function round(number,deci)
- local num = tostring(number)
- local num2 = ""
- local num3 = ""
- local num4
- local num5
- local savevar1 = ""
- if deci ~= 0 then
- if num2 ~= "" then num = num2 end
- for i=1,#num do
- if string.sub(num,i,i) == "." then
- num3 = tonumber(string.sub(num,deci+i+1,deci+i+1))
- num4 = tonumber(string.sub(num,deci+i,deci+i))
- if num3 == "" or num3 == nil then break end
- if num3 >= 5 then
- num = string.sub(num,1,i-1+deci)..tostring(num4+1)
- else
- num = string.sub(num,1,i-1+deci)..tostring(num4)
- end
- end
- end
- else
- for i=1,#num do
- if string.sub(num,i,i) == "." then
- num3 = string.sub(num,i+1,i+1)
- num5 = string.sub(num,i-1,i-1)
- num4 = i
- break
- end
- end
- num3 = tonumber(num3)
- num5 = tonumber(num5)
- if num3 >= 5 then
- num = string.sub(num,1,num4-2)..tostring(num5+1)
- else
- num = string.sub(num,1,num4)
- end
- num = tonumber(num)
- end
- return num
- end
- local function compareColors(color1,color2)
- local r1 = round(color1.R,1)
- local g1 = round(color1.G,1)
- local b1 = round(color1.B,1)
- local r2 = round(color2.R,1)
- local g2 = round(color2.G,1)
- local b2 = round(color2.B,1)
- if (r1 == r2 and b1 == b2 and g1 == g2) then
- return true
- else
- return false
- end
- end
- local ZombieP = Instance.new("Part",workspace)
- ZombieP.Position = Vector3.new(22,3,10)
- ZombieP.Size = Vector3.new(2,2,2)
- ZombieP.Anchored = true
- ZombieP.Material = ("Neon")
- ZombieP.BrickColor = BrickColor.new("Bright green")
- ZombieP.Locked = true
- local ClickZ = Instance.new("ClickDetector", ZombieP)
- function Green(player)
- player.Character["Head"].Color = Color3.new(0,1,0)
- player.Character["Torso"].Color = Color3.new(0,1,0)
- player.Character["Left Leg"].Color = Color3.new(0,1,0)
- player.Character["Left Arm"].Color = Color3.new(0,1,0)
- player.Character["Right Arm"].Color = Color3.new(0,1,0)
- player.Character["Right Leg"].Color = Color3.new(0,1,0)
- player.Character.Humanoid.WalkSpeed = 10
- local Check = false
- player.Character.Torso.Touched:Connect(function(hit)
- if game.Players:GetPlayerFromCharacter(hit.Parent) and not compareColors(hit.Parent.Torso.Color,Color3.new(0,1,0)) and not Check then
- hit.Parent.Humanoid.Health = hit.Parent.Humanoid.Health - 10
- Check = true
- wait(1.5)
- Check = false
- end
- end)
- end
- local function ZClicked(player)
- Green(player)
- ZombieP.BrickColor = BrickColor.new("Really black")
- wait(.5)
- ZombieP.BrickColor = BrickColor.new("Bright green")
- end
- ClickZ.MouseClick:connect(ZClicked)
- end
- function BCube
- ()local SoundP = Instance.new("Part",workspace)
- SoundP.Position = Vector3.new(10,3,10)
- SoundP.Size = Vector3.new(2,2,2)
- SoundP.Anchored = true
- SoundP.Material = ("SmoothPlastic")
- SoundP.BrickColor = BrickColor.new("Medium stone grey")
- SoundP.Locked = true
- local ClickD = Instance.new("ClickDetector", SoundP)
- local Sound = Instance.new("Sound",SoundP)
- local function soundplay()
- Sound.SoundId = "rbxassetid://2803889112"
- Sound.Volume = 5
- Sound:Play()
- Sound.TimePosition = .5
- end
- local function Clicked()
- soundplay()
- SoundP.BrickColor = BrickColor.new("Bright orange")
- SoundP.Material = ("Neon")
- wait(.5)
- SoundP.BrickColor = BrickColor.new("Medium stone grey")
- SoundP.Material = ("SmoothPlastic")
- end
- ClickD.MouseClick:connect(Clicked)
- local Apart = Instance.new("Part",workspace)
- Apart.Position = Vector3.new(10, 9.25, 10)
- Apart.Anchored = true
- Apart.Material = ("Neon")
- Apart.Size = Vector3.new(.5,1.5,0.5)
- Apart.Locked = true
- local Awedge1 = Instance.new("WedgePart",workspace)
- Awedge1.Position = Vector3.new(9.625, 7.75, 10)
- Awedge1.Anchored = true
- Awedge1.Material = ("Neon")
- Awedge1.Size = Vector3.new(0.5, 0.75, 1.5)
- Awedge1.Orientation = Vector3.new(-90, 90, 0)
- Awedge1.Locked = true
- local Awedge2 = Instance.new("WedgePart",workspace)
- Awedge2.Position = Vector3.new(10.375, 7.75, 10)
- Awedge2.Anchored = true
- Awedge2.Material = ("Neon")
- Awedge2.Size = Vector3.new(0.5, 0.75, 1.5)
- Awedge2.Orientation = Vector3.new(-90, -90, 0)
- Awedge2.Locked = true
- end
- function HCube()
- local HealP = Instance.new("Part",workspace)
- HealP.Position = Vector3.new(18,3,10)
- HealP.Size = Vector3.new(2,2,2)
- HealP.Anchored = true
- HealP.Material = ("SmoothPlastic")
- HealP.BrickColor = BrickColor.new("Bright green")
- HealP.Locked = true
- local ClickH = Instance.new("ClickDetector", HealP)
- function Heal(player)
- player.Character.Humanoid.Health = 100
- end
- local function HClicked(player)
- Heal(player)
- HealP.Material = ("Neon")
- wait(.5)
- HealP.Material = ("SmoothPlastic")
- end
- ClickH.MouseClick:connect(HClicked)
- end
- function DCube()
- local DamageP = Instance.new("Part",workspace)
- DamageP.Position = Vector3.new(14,3,10)
- DamageP.Size = Vector3.new(2,2,2)
- DamageP.Anchored = true
- DamageP.Material = ("SmoothPlastic")
- DamageP.BrickColor = BrickColor.new("Bright red")
- DamageP.Locked = true
- local ClickD = Instance.new("ClickDetector", DamageP)
- function Damage(player)
- player.Character.Humanoid.Health = player.Character.Humanoid.Health - 20
- end
- local function DClicked(player)
- Damage(player)
- DamageP.Material = ("Neon")
- wait(.5)
- DamageP.Material = ("SmoothPlastic")
- end
- ClickD.MouseClick:connect(DClicked)
- end
- for i,v in pairs(game.Players:GetChildren())do v.Chatted:Connect(function(msg)
- if msg == ";DCube" then DCube()
- elseif msg == ";HCube" then HCube()
- elseif msg == ";BCube" then BCube()
- elseif msg == ";ZCube" then ZCube()
- elseif msg == ";AllCubes" then HCube() BCube() ZCube() DCube()
- end
- end)
- end
Add Comment
Please, Sign In to add comment