hi im stuck with a touched function that fires only once, it involves attributes and that so
here
ball = script.Parent
local att = ball:GetAttribute("LastTouch")
ball.Touched:Connect(function(hit)
if hit.Parent:FindFirstChildOfClass("Humanoid") then
ball:SetAttribute("LastTouch", hit.Parent.Name)
end
end)
Okay, so do you want it to only touch once or do you want it to not touch again if the last touch is the same as the new touch?
perhaps I didnt explain well (Sorry)
I want it to be like, when a player touches the ball the attribute says the players name,
once a different player touches it the attribute texts their name
problem is that It only changes once and if someone else touches it it doesnt change.
Well, did you add if ball:GetAttribute("LastTouch")==hit.Parent.Name then return end
?
It should be right before the line that begins with if hit.Parent
.
Thank You! the code is now working.
(maybe it worked before because i did 2 player test but)