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

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

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

✓ Accepted answer

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

3 comments

0

Thanks.

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.

0

i forgot the wait 5 lol

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