|
| 29 Mar 2014 01:23 PM |
I have a script that it gives you a tool that should cloak you, and it doesn't. Please help!
bin = script.Parent
backupFace = nil backupShirt = nil local hurtConnect = nil local lastHealth = 0 local cloakValue= Instance.new("NumberValue") cloakValue.Name = "CloakValue" cloakValue.Value = 100 local isCloaked = false
function BlendTransparency(char, blendTo) local c = char:GetChildren() for ind, x in ipairs(c) do if(x:IsA("Part")) then x.Transparency = 0.5 end if(x:IsA("Hat")) then x.Handle.Transparency = 0.5 end end wait(0.5) for ind, x in ipairs(c) do if(x:IsA("Part")) then x.Transparency = blendTo end if(x:IsA("Hat")) then x.Handle.Transparency = blendTo end end end
--[[function BlendTransparencyDown(char, blendTo) local c = char:GetChildren() for i=1, blendTo, -0.3 do for ind, x in ipairs(c) do if(x:IsA("Part")) then x.Transparency = i end if(x:IsA("Hat")) then x.Handle.Transparency = i end end wait(0.1) end for ind, x in ipairs(c) do if(x:IsA("Part")) then x.Transparency = blendTo end if(x:IsA("Hat")) then x.Handle.Transparency = blendTo end end end]]--
function CloakFull() isCloaked = true if (hurtConnect ~= nil) then hurtConnect:disconnect() end local player = game.Players.LocalPlayer hurtConnect = player.Character.Humanoid.Changed:connect(function(prop) if (player.Character.Humanoid.Health <= 0) then Uncloak() elseif (prop == "Health" and player.Character.Humanoid.Health < lastHealth) then CloakFull() end lastHealth = player.Character.Humanoid.Health end) local player = game.Players.LocalPlayer if player == nil then return end local char = player.Character local face = char.Head:FindFirstChild("face") local shirt = char.Torso:FindFirstChild("roblox") if (face ~= nil) then backupFace = face:Clone() end if (shirt ~= nil) then backupShirt = shirt:Clone() end BlendTransparency(char, 1) if (face ~= nil) then char.Head.face.Parent = nil end if (shirt ~= nil) then char.Torso.roblox.Parent = nil end end
function Uncloak() isCloaked = false if (hurtConnect ~= nil) then hurtConnect:disconnect() hurtConnect = nil end local player = game.Players.LocalPlayer if player == nil then return end local char = player.Character local face = char.Head:FindFirstChild("face") local shirt = char.Torso:FindFirstChild("roblox") if (face == nil and backupFace ~= nil) then backupFace.Parent = char.Head end if (shirt == nil and backupShirt ~= nil) then backupShirt.Parent = char.Torso end BlendTransparency(char, 0) bin.Active = false end
function onSelected(mouse) local player = game.Players.LocalPlayer if player == nil then return end CloakFull() lastHealth = player.Character.Humanoid.Health cloakValue.Parent = player.Character end
function onDeselected(mouse) if (hurtConnect ~= nil) then hurtConnect:disconnect() hurtConnect = nil end if (isCloaked == true) then Uncloak() end end
bin.Selected:connect(onSelected) bin.Deselected:connect(onDeselected)
wait(1)
while true do if (isCloaked == true) then cloakValue.Value = cloakValue.Value - .50 if (cloakValue.Value <= 0) then cloakValue.Value = 0 Uncloak() end else cloakValue.Value = cloakValue.Value + 0.35 if (cloakValue.Value >= 100) then cloakValue.Value = 100 end end wait(0.1) end
|
|
|
| Report Abuse |
|
|
|
| 29 Mar 2014 02:23 PM |
| Please help! I don't know what's wrong with it |
|
|
| Report Abuse |
|
|
|
| 29 Mar 2014 02:24 PM |
don't use free models.
#nerdsunited |
|
|
| Report Abuse |
|
|
|
| 29 Mar 2014 02:42 PM |
| I never used a free model, I am using someone else's uncopylocked place and I attempted to fix the script myself but was unable to. I want to make this game better, currently, I am building several more maps for it and adding more stuff daily. This is just a script that isn't working |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 30 Mar 2014 10:16 AM |
| I figured out it was broken by an update.. ofcourse, now what do I need to do to fix it? |
|
|
| Report Abuse |
|
|
GFXdylan
|
  |
| Joined: 09 Feb 2013 |
| Total Posts: 679 |
|
| |
|
|
| 30 Mar 2014 10:21 AM |
What do you mean? @ above It's supposed to cloak you when you equip the tool |
|
|
| Report Abuse |
|
|
robocu3
|
  |
| Joined: 13 Mar 2009 |
| Total Posts: 6485 |
|
|
| 30 Mar 2014 10:39 AM |
Micah, the script is fine. Try putting it in a local script, for future reference, server side scripts no longer work in hopperbins. -=Robo=- |
|
|
| Report Abuse |
|
|
|
| 30 Mar 2014 12:46 PM |
| How do I put it into local script? |
|
|
| Report Abuse |
|
|
|
| 30 Mar 2014 12:47 PM |
Create a localscript from the objects menu. Copy and paste your code into it and delete the original script that wasn't working, then test.
When life gives you lemons... BURN HIS HOUSE DOWN! >:D |
|
|
| Report Abuse |
|
|
|
| 30 Mar 2014 01:08 PM |
| THANK YOU SO MUCH, OMG, THANK YOU SOOOOOO MUCH |
|
|
| Report Abuse |
|
|