server script loops doesn't function correctly. how do i use loops in this situation?
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)
01 | local tEvent = Instance.new( "RemoteEvent" ) |
03 | tEvent.Parent = script.Parent.Parent.Parent.ReplicatedStorage |
05 | tEvent.OnServerEvent:Connect( function (Player) |
07 | local Character = Player.Character or Player.CharacterAdded:wait() |
11 | local humanoid = Character.Humanoid |
13 | local animation = script.Animation |
15 | local animtrack = humanoid:LoadAnimation(animation) |
20 | local swave = Instance.new( "Part" ) |
22 | swave.Size = Vector 3. new( 3 , 3 , 3 ) |
23 | swave.CanCollide = false |
24 | swave.Transparency = 0.7 |
25 | swave.BrickColor = BrickColor.new( "Medium blue" ) |
26 | swave.Material = "Neon" |
27 | swave.TopSurface = "Smooth" |
28 | swave.BottomSurface = "Smooth" |
30 | swave.CFrame = Player.Character.HumanoidRootPart.CFrame*CFrame.new( 0 , 2 , 0 ) |
31 | swave.Parent = workspace |
34 | swave.Size = Vector 3. new( 1 , 1 , 1 ) |