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

How to make a wave?

Asked by 10 years ago

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 :)

0
This is not a request website. I recommend looking into CFrame, Vector3, and for loops. The official Roblox wiki as well as the glossary on this website are great sources. MrFlimsy 345 — 10y
0
This is a correctly formated question. He just needs help and some explanation, at least he tried to script, thats what really counts :) HexC3D 830 — 10y

1 answer

Log in to vote
1
Answered by
HexC3D 830 Moderation Voter
10 years ago

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.

Ad

Answer this question