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

Error that I dont know how to fix :17: Expected ')' (to close '(' at line 7), got 'end?

Asked by 3 years ago

ServerScriptService.ServerScriptService:17: Expected ')' (to close '(' at line 7), got 'end

game.ReplicatedStorage.Events.Ice.OnServerEvent:Connect(function(player, part, mousePos)
    if part == "Replicate" then
        game.ReplicatedStorage.Events.Ice:FireAllClients(player, mousePos) --Tell every client the skill has been casted
    elseif part.Parent:FindFirstChild("Humanoid") then
        part.Parent:FindFirstChild("Humanoid"):TakeDamage(20)
        script.Parent.Touched:Connect(function(hit)
            script.Parent.Touched:connect(function(hit)
                local humanoid = hit.Parent:FindFirstChild("Humanoid")
                humanoid.WalkSpeed = 0
                wait(2)
                humanoid.WalkSpeed = 16


            end)
            end
    end
end)

Thank you for reading please tell me what I'm doing wrong sorry I'm a beginner scripter

0
I will try to help but if I was you organize your code better cause its a pain to look through Jackmods_YT -12 — 3y
0
I got the script of a tutorial im editing it so it freezes the player when the iceball hits the player also thank you alot for helping robot7866 36 — 3y

2 answers

Log in to vote
0
Answered by 3 years ago

You forgot one end) Fixed it for ya think I fixed it if not Just comment on this

game.ReplicatedStorage.Events.Ice.OnServerEvent:Connect(function(player, part, mousePos)
    if part == "Replicate" then
        game.ReplicatedStorage.Events.Ice:FireAllClients(player, mousePos) --Tell every client the skill has been casted
    elseif part.Parent:FindFirstChild("Humanoid") then
        part.Parent:FindFirstChild("Humanoid"):TakeDamage(20)
        script.Parent.Touched:Connect(function(hit)
            script.Parent.Touched:connect(function(hit)
                local humanoid = hit.Parent:FindFirstChild("Humanoid")
                humanoid.WalkSpeed = 0
                wait(2)
                humanoid.WalkSpeed = 16


            end)
            end
    end
end)
end)
0
Its still not working   ServerScriptService.ServerScriptService:16: Expected ')' (to close '(' at line 6), got 'end' robot7866 36 — 3y
0
There has to be another bracket cancle5 120 — 3y
0
Ok ill try robot7866 36 — 3y
Ad
Log in to vote
0
Answered by
Oxprem 140
3 years ago

I see your problem. You forgot to put an ) on line 15, like this:

game.ReplicatedStorage.Events.Ice.OnServerEvent:Connect(function(player, part, mousePos)
    if part == "Replicate" then
        game.ReplicatedStorage.Events.Ice:FireAllClients(player, mousePos) --Tell every client the skill has been casted
    elseif part.Parent:FindFirstChild("Humanoid") then
        part.Parent:FindFirstChild("Humanoid"):TakeDamage(20)
        script.Parent.Touched:Connect(function(hit)
            script.Parent.Touched:connect(function(hit)
                local humanoid = hit.Parent:FindFirstChild("Humanoid")
                humanoid.WalkSpeed = 0
                wait(2)
                humanoid.WalkSpeed = 16


            end)
            end)
    end
end)

Hope this helped!

Answer this question