Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why wont this script work?

Asked by 8 years ago



function Start() if script.Parent.Attack.Value.Value == "Laser eye" then wait() local Laser = game.Lighting.Laser:Clone() Laser.Parent = script.Parent Laser.Position = script.Parent.Position Laser.Part.Position = script.Parent.Position print("okkkk") game.Debris:AddItem(Laser,.5) print("Ok") end if script.Parent.Attack.Value.Value == "Laser Burst" then wait(2) local Laser = game.Lighting.Laser:Clone() Laser.Parent = script.Parent Laser.Position = script.Parent.Position Laser.Part.Position = script.Parent.Position print("okkkk") game.Debris:AddItem(Laser,.5) end end skill = {"Laser Eye","Laser Brust"} script.Parent.Attack.Value.Value = skill[math.random(1,#skill)] Start() print("okoooo")

No errors in output. The lay out is Handle/Attack/Value

0
You're comparing "Laser eye" to "Laser Eye" and "Laser Brust" to "Laser Burst". M39a9am3R 3210 — 8y
0
No i havent made Laser burst its just for testing. WHta im having problem is when i do Start() the function wont run KFCPhoeyu 41 — 8y
1
what he is saying is, in the table for skill{} you have your data spelled incorrectly in relation to the 'if' functions on lines 03 and 14 BSIncorporated 640 — 8y
0
What do you mean can u help me fix? I just started to use tabels so im not a pro at them KFCPhoeyu 41 — 8y

1 answer

Log in to vote
-2
Answered by 8 years ago

i just corected your spelling. if it still dont work add print("ok") after game.Debris:AddItem(Laser,.5)


function Start() if script.Parent.Attack.Value.Value == "Laser Eye" then wait() local Laser = game.Lighting.Laser:Clone() Laser.Parent = script.Parent Laser.Position = script.Parent.Position Laser.Part.Position = script.Parent.Position print("okkkk") game.Debris:AddItem(Laser,.5) print("Ok") end if script.Parent.Attack.Value.Value == "Laser Burst" then wait(2) local Laser = game.Lighting.Laser:Clone() Laser.Parent = script.Parent Laser.Position = script.Parent.Position Laser.Part.Position = script.Parent.Position print("okkkk") game.Debris:AddItem(Laser,.5) end end skill = {"Laser Eye","Laser Burst"} script.Parent.Attack.Value.Value = skill[math.random(1,#skill)] Start() print("okoooo")
Ad

Answer this question