How do you make a wave in a game. I am making survive the Tsunami and can't get an ideal wave script. Someone suggested this on a ROBLOX message but it does not work. Here is script,
local part = game.Workspace.Part local pos = game.Workspace.Part.Position while true do part.Size = part.Size + 0, 10, 0 pos = pos + 0, 10, 0 if part.Size == "200" then local m = Instance.new('Message', game.Workspace) m.Text = "Round Over!" wait(7.5) m.Text:Destroy() local k = game.Players:GetAllChildren k.Humanoid.Health = 0 end end end
I can see there are a lot of errors. Plz help. The objective of this script is that once the part (wave) reaches the end of the baseplate it will destroy and the message will appear. The size of the basplate is 550 length x 275 width... I might change this later just tell me in the script where to put length and width. thx :)
You made a lot of mistakes and I would feel guilty if I didn't correct you because this why this website was created.
local part = game.Workspace.Part local pos = game.Workspace.Part while true do for i = 1,20 do -- Makes the Vector Y coordinate equal 100 :) part.Size = part.Size + Vector3.new(0, 5, 0) -- Try looking to Vector3.new on Wiki also to get a better idea. end for i= 1,10 do pos.Position = pos.Position + Vector3.new(10,0,0) -- This will move it Side ways since Vector3.new(x,y,z) end if part.Size == Vector3.new(0,100,0) then local m = Instance.new('Message', game.Workspace) m.Text = "Round Over!" wait(7.5) m.Text:Destroy() end local k = game.Players:GetPlayers() -- Get Children is just fine also, you missed a brackets, but I replaced it with GetPlayers() or else I would get a lot of errors if I did GetChildren(). for i = 1,#k do k[i].Character.Humanoid.Health = 0 end wait(5) -- 5 seconds till the script starts again. end
This should at least make the script work, this might not be what your getting at but atleast this will leave it to you to edit it.