So I'm making a basketball game where if you step on a part and shoot a basketball and that hits the part on the basket then it should add 3 points or add 3 to the number value. But it does not let me? I don't really know how to do it but i tried
local work = game.Workspace
local threecorner = work.thing
if script.Parent.Touched and threecorner.Touched then
for i,v in pairs (game.Players:GetChildren()) do
if v.PlayerGui:FindFirstChild("ScreenGui") then
v.PlayerGui.ScreenGui.TextLabel.Value.Value = v.PlayerGui.ScreenGui.TextLabel.Value.Value + 3
end
end
end

4 comments
If this is in a server script, then that might be your problem. Unless you add "ScreenGui" with a script after the player has spawned, then the server won't see the player's PlayerGui contents. This is because they do not replicate to the server from StarterGui.
Touched is an event, not a property?
yeah idk what to do loll xd
Do not use if part.Touched then use part.Touched:Connect(function(hit) .. end)