I am making a soccer game, I want the status β (the textlable), to say the specific player that scored but I cant get the player, with my knowledge
heres my function
local function score(team)
team.Text = team.Text + 1 -- adds a point to a teams textlable
status.Text = team.Name.." Scores!" -- I only can get the team that scored though
ball.Anchored = true -- the ball is the ball you hit the goal with
wait(5)
status.Text = ""
resetTeams()
resetBall(1)
end
although alvinblox didnt help me enough with attributes
ball = script.Parent
local att = ball:GetAttribute("LastTouch")
ball.Touched:Connect(function(hit)
if hit.Parent:FindFirstChildOfClass("Humanoid") then
att = hit.Parent.Name
end
end)
this script I tried doesnt work
nothing is in output, string text doesnt change