Hello, i have a game where you can spawn cars. The spawners worked for a while but now they stopped working. Script:
script.Parent.MouseButton1Click:connect(function(GetCar)
Mod = game.ServerStorage.HHH --Change test to whatever you have named the item you want to spawn
clone = Mod:clone()
clone.Parent = workspace
clone:MakeJoints()
end)
The cars duplicate in workspace so i don’t really know why they don’t spawn. Maybe its my fault that i moved them somewhere.
Did you try using local before declaring your variables? Be more specific about what you mean by they “stopped working”. Try to attach a video of the problem so I can properly debug
Like the cars doesn’t spawn. There is a part and there is a text button on it which spawns a car in location where its set. But when i tried to spawn it next day it didn’t spawn.
Im not good at scripting so i just paste them. First one is GlobalUsedAsLocal: (2,3) Global ‘Mod’ is only used in the enclosing function defined at line 1; consider changing it to local and second one is GlobalUsedAsLocal: (3,3) Global ‘clone’ is only used in the enclosing function defined at line 1; consider changing it to local.
Sorry i don’t understand scripting but i need to rename model to the car name? Because car and spawner isn’t called model i just called it here as model.
script.Parent.MouseButton1Click:connect(function(GetCar)
local Mod = game.ServerStorage.BRICE --Change test to whatever you have named the item you want to spawn
clone = Mod:clone()
clone.Parent = workspace
BRICE:MoveTo(-172.15, 0.799, 517.5)
end)
I referred to the car model clone variable, which isclone
If you put the actual car name, BRICE, the game will error since there is no variable of it. So the correct code should be:
script.Parent.MouseButton1Click:connect(function(GetCar)
local Mod = game.ServerStorage.BRICE --Change test to whatever you have named the item you want to spawn
local clone = Mod:clone()
clone.Parent = workspace
clone:MoveTo(Vector3.new(-172.15, 0.799, 517.5))
end)