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

Why doesn't this work?

Asked by 8 years ago

So, I am trying to make a 'zombie' appear after 35 seconds have passed once the game has started. I am making a level that is designed for certain enemies to appear after a certain time has passed. So after 35 seconds, I want a 'Scarecrow' to appear. Though in the script, the Output is telling me that a 'local' was expecting an '='. I am confused why that is. So here is the script, and if there is an easier way to do this, please say so. I am only a beginner level scripter and I am still learning.

local RightLeg = script.Parent.Right Leg
local Torso = script.Parent.Torso
local LeftArm = script.Parent.left arm
local zarm = script.Parent.zarm
local Spawning = script.Parent.Spawning
local Scarecrow = script.Parent
local Head = script.Parent.Head
local LeftLeg = script.Parent.Left Leg
if 1 + 1 = 2 then
    wait(35)
    Head.Transparency = 0
    Head.Anchored = false
    LeftLeg.Transparency = 0
    LeftLeg.Anchored = false
    RightLeg.Transparency = 0
    RightLeg.Anchored = false
    Torso.Transparency = 0
    Torso.Anchored = false
    LeftArm.Transparency = 0
    LeftArm.Anchored = false
    zarm.Transparency = 0
    zarm.Anchored = false
    wait(1)
    Destroy:Spawning
    end
end
0
And just wondering, whats the "if 1+1=2" about? Pointless... ItsMeKlc 235 — 8y

1 answer

Log in to vote
0
Answered by
ItsMeKlc 235 Moderation Voter
8 years ago

replace lines 1-8 with


local RightLeg = script.Parent["Right Leg"] local Torso = script.Parent.Torso local LeftArm = script.Parent["left arm"] local zarm = script.Parent.zarm local Spawning = script.Parent.Spawning local Scarecrow = script.Parent local Head = script.Parent.Head local LeftLeg = script.Parent["Left Leg"]

also make sure you're using the EXACT names of the parts

0
Well, I needed a function to start the script right? One that will always be true? Because I dont know how to tell the script to start right when the game starts. Now the '=' says it was expecting 'then.' why is that? Malefactus 55 — 8y
0
1. You don't need a function it will automatically run 2. That's not a function 3. Did it work? ItsMeKlc 235 — 8y
0
Yup. It worked. I went ahead and removed the Destroy command as well since there is no harm in leaving the script as it is. Thank you so much! Malefactus 55 — 8y
Ad

Answer this question