Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why doesn't this work?

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

1 comment

0

And just wondering, whats the "if 1+1=2" about? Pointless...

1 answer

✓ Accepted answer

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

3 comments

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?

0
  1. You don't need a function it will automatically run 2. That's not a function 3. Did it work?
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!

This discussion is preserved as it was. New answers, comments, and votes are closed.