so basically, i have a localscript that uses a key function to fireserver to a remoteevent. and when this event is recieved from the server script, it is suppose to create a ball that increases sizes then eventually dissapears.
however, with my minimal knowledge of loops, i cannot understand how to do this. can someone tell me what's wrong with this loop script?
SERVER SCRIPT: (this is where the issue lies)
local tEvent = Instance.new("RemoteEvent")
tEvent.Name = "tEvent"
tEvent.Parent = script.Parent.Parent.Parent.ReplicatedStorage
tEvent.OnServerEvent:Connect(function(Player) -- Player who fired the event
local Character = Player.Character or Player.CharacterAdded:wait()
-- animation
local humanoid = Character.Humanoid
local animation = script.Animation
local animtrack = humanoid:LoadAnimation(animation)
animtrack:Play()
wait(.4)
local swave = Instance.new("Part")
swave.Shape = "Ball"
swave.Size = Vector3.new(3,3,3)
swave.CanCollide = false
swave.Transparency = 0.7
swave.BrickColor = BrickColor.new("Medium blue")
swave.Material = "Neon"
swave.TopSurface = "Smooth"
swave.BottomSurface = "Smooth"
swave.Anchored = true
swave.CFrame = Player.Character.HumanoidRootPart.CFrame*CFrame.new(0, 2, 0)
swave.Parent = workspace
for i = 4, -1, 0 do
swave.Size = Vector3.new(1,1,1)
end
wait(1)
swave:Destroy()
end)

4 comments
at line 33, make it: for i = 4, 0, -1 do
yeah, it works but how would i make the ball increase in size? in this situation i cant figure it out.
i suggest putting this script in server script service, because currently the client can access replicated storage and fire that event
its already inside the server script service