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

Making a Fish spawning Script, not working for some weird reason, yet doesn't give errors?

Asked by 5 years ago
Edited 5 years ago

so I made this script to make fish spawn after 5 seconds, not sure why it doesn't work. Any ideas will be appreciated :D

                while wait(5) do

                  local Mod = game.ServerStorage.Fish
                  local clone = Mod:clone()
                  clone.Parent = workspace
                  clone:MakeJoints()
                   end

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

In line 4.

It’s :Clone(), not :clone(). You must spell everything with its proper capitalisation. Missing/adding an uppercase will cause code to error. Scripting is case sensitive.

while true do
    local fish = game:GetService('ServerStorage').Fish:Clone()
    fish.Parent = game.Workspace --not 'workspace'. that recently got deprecated.
    fish:MakeJoints() --If the fish is a model, call this method. Else, don’t.
    wait(5) --forgot this lol
end
0
Thanks. mixgingengerina10 223 — 5y
0
If you accept this answer please mark it as so, also do not use while true do for that, that would crash the game since it would create a new instance in the workspace infinitely. valchip 789 — 5y
0
i forgot the wait 5 lol User#19524 175 — 5y
Ad

Answer this question