So I have been working on a football game for a long time, and this is the last thing I will need to do. I have done the touch script, which prints but it does not increase the IntValue. Any help is phenomenally appreciated!
You have provided no code and you expect others to help you. Please provide us with something we can work off of. Send the portion of the script that is responsible for this
There is no code, because I am asking for code. I donβt have any reliable source that I know that works, so I am asking for a script. There really is no script that should be worked on, Iβm just asking what to do.
So you have a part that prints when a goal is scored? then find where it prints and add 1 to the intvalue there, and add a debounce so it doesnt happen more then once.
So can you tell me what to do inside the script? Also, do you have any idea for the server script? Thanks for the help!
Hey @Omnomc, in future try yourself but I will help you this time.
local ball = ball -- what is the ball? put it here?
script.Parent.Touched:Connect(function(hit)
if hit.Parent = ball then
game.ReplicatedStorage.ScoreValue.Value = game.ReplicatedStorage.ScoreValue.Value + 1
print("Goal! Team now has "..game.ReplicatedStorage.ScoreValue.Value.." goals.")
local counter = idk -- put the textlabel or whatever here
counter.Text = game.ReplicatedStorage.ScoreValue.Value.." goals"
end
end)
Ok thanks! Ill try it in a sec!