Scripting help. Spawn spawns once the player clicks on it

Why isn’t this working?
local ServerStorage = game:GetService(“ServerStorage”)

local PartSize = Vector3.new(5, 5, 5)

local PartColor = BrickColor.new(“Bright red”)

local PartMaterial = Enum.Material.Neon

local PartShape = Enum.PartType.Ball

local FireSize = 30

local FireHeat = 20

local FireColor = Color3.new(1, 0, 0)

local FireSecondaryColor = Color3.new(1, 1, 0)

while true do

local NewPart = Instance.new(“Part”)

NewPart.Size = PartSize

NewPart.Position = Vector3.new(math.random(-50, 50), 50, math.random(-50, 50))

NewPart.BrickColor = PartColor

NewPart.Material = PartMaterial

NewPart.Shape = PartShape

NewPart.CanCollide = true

NewPart.Anchored = false

NewPart.Name = “Fire Part”

NewPart.Parent = ServerStorage

local FireEffect = Instance.new(“Fire”)

FireEffect.Size = FireSize

FireEffect.Heat = FireHeat

FireEffect.Color = FireColor

FireEffect.SecondaryColor = FireSecondaryColor

FireEffect.Parent = NewPart

wait(1)

end

What’s the script supposed to be doing? If it’s supposed to be like raining fireballs, then the only issue I can see is that you’re setting the parts parent to ServerStorage, not workspace.

1 Like

It’s a part that spawns on fire. The problem is it doesn’t work. I dibbled checked the script and it still won’t spawn stuff.

I tested the script in studio, they spawned perfectly fine when I put the parent to workspace.

In the forum, put the code between two sets of: ```

local PartSize = Vector3.new(5, 5, 5)

local PartColor = BrickColor.new(“Bright red”)

local PartMaterial = Enum.Material.Neon

local PartShape = Enum.PartType.Ball

local FireSize = 30

local FireHeat = 20

local FireColor = Color3.new(1, 0, 0)

local FireSecondaryColor = Color3.new(1, 1, 0)

while true do

local NewPart = Instance.new(“Part”)

NewPart.Size = PartSize

NewPart.Position = Vector3.new(math.random(-50, 50), 50, math.random(-50, 50))

NewPart.BrickColor = PartColor

NewPart.Material = PartMaterial

NewPart.Shape = PartShape

NewPart.CanCollide = true

NewPart.Anchored = false

NewPart.Name = “Fire Part”

NewPart.Parent = ServerStorage

local FireEffect = Instance.new(“Fire”)

FireEffect.Size = FireSize

FireEffect.Heat = FireHeat

FireEffect.Color = FireColor

FireEffect.SecondaryColor = FireSecondaryColor

FireEffect.Parent = NewPart

wait(1)

end

And like Ethan says, you are parenting the part to the Server Storage, maybe you want to parent it to the workspace

NewPart.Parent = workspace

you have to parent it to workspace you parented it to serverstorage

ur code doesn’t work. it shows errors

Its literally your code but formatted, lol