|
| 10 Mar 2013 07:54 AM |
Begginer scripter here :3
I made this "Health ball" script and its a bit broken..
I think i forgot an End or i messed it up :P
while true do wait (2) x = Instance.new("Part") x.Parent = game.Workspace x.Shape = "Ball" x.Position = game.Workspace.CubeBuilder12.Head.Position x.BrickColor = BrickColor.Random() x.Transparency = 0.4 x.Name = "HealthBall"
function onTouched(hit) human = hit.Parent:FindFirstChild("Humanoid") if human ~= nil then human.Health = 100 end end
script.Parent.Touched:connect(onTouched)
Instance.new("Decal",game.Workspace.HealthBall).Texture = "http://www.roblox.com/asset/?id=96574021" |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Mar 2013 08:02 AM |
Try this.
while true do wait (2) x = Instance.new("Part") x.Parent = game.Workspace m=Instance.new("Decal",game.Workspace.HealthBall).Texture"http://www.roblox.com/asset/?id=96574021" m.Parent = x x.Shape = "Ball" x.Position = game.Workspace.CubeBuilder12.Head.Position -- Not sure why you have two equal signs here, that part is for you to fix. /\ x.BrickColor = BrickColor.Random() x.Transparency = 0.4 x.Name = "HealthBall" end function onTouched(hit) human = hit.Parent:FindFirstChild("Humanoid") if human ~= nil then human.Health = 100 end end
script.Parent.Touched:connect(onTouched)
Instance.new("Decal",game.Workspace.HealthBall).Texture = "http://www.roblox.com/asset/?id=96574021" |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Mar 2013 08:07 AM |
^dint work
I fixed the position but it dint work |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Mar 2013 08:14 AM |
| Healthball is not a valid member of workspace .-. |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Mar 2013 11:14 AM |
You did miss an end, but it's a bit more then that. A while true do loop will keep doing the code inbetween it and the matching end forever, meaning it will never reach the connection line for Touched.
function onTouched(hit) human = hit.Parent:FindFirstChild("Humanoid") if human ~= nil then human.Health = 100 end end
script.Parent.Touched:connect(onTouched)
while true do wait (2) x = Instance.new("Part") x.Parent = game.Workspace x.Shape = "Ball" x.Position = game.Workspace.CubeBuilder12.Head.Position x.BrickColor = BrickColor.Random() x.Transparency = 0.4 x.Name = "HealthBall" end |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2013 11:17 AM |
Wow rendersettings fixed my script e_o
Cube will test dat |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Mar 2013 11:20 AM |
I...can't tell if that is supposed to be positive or not. I missed a part when copy-pasting though.
function onTouched(hit) human = hit.Parent:FindFirstChild("Humanoid") if human ~= nil then human.Health = 100 end end
while true do wait (2) x = Instance.new("Part") x.Parent = game.Workspace x.Shape = "Ball" x.Position = game.Workspace.CubeBuilder12.Head.Position x.BrickColor = BrickColor.Random() x.Transparency = 0.4 x.Name = "HealthBall"
x.Touched:connect(onTouched) --I assume you actually wanted the BALL to heal you, and not script.Parent. Sorry.
Instance.new("Decal",x).Texture = "http://www.roblox.com/asset/?id=96574021" end |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2013 11:24 AM |
IT WORKED!!! THANKS MASTERSCRIPTER YA
My very first script! yeeeees |
|
|
| Report Abuse |
|
|