Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

2 comments

0

I will try to help but if I was you organize your code better cause its a pain to look through

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

2 answers

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)

3 comments

0

Its still not working   ServerScriptService.ServerScriptService:16: Expected ')' (to close '(' at line 6), got 'end'

0

There has to be another bracket

0

Ok ill try

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!

This discussion is preserved as it was. New answers, comments, and votes are closed.