The Detector part. is located in a Model, In the workspace and the Script is located in the Detector part. If the ball hits the part, It should add one to the scoreboard GUI, But it's not working. The script is located below.

script.Parent.OnTouched:connect(function(o)
    if o.Name == "Ball" then
        for i,v in pairs(game:GetService("Players"):GetChildren()) do
            local wrap = coroutine.wrap(function()
                v.ScreenGui.Frame.RedS.Text = tostring(v.ScreenGui.Frame.RedS.Text) + 1
            end)
            wrap()
        end
    end
end)

1 comment

0

I don't think there's any need for the coroutine..also, you are trying to add 1 to a string