Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How can I stop a teammate from stealing their own teammate's ball?

There is a basketball for a roblox basketball game, the steal script works fine, but the problem is my own teammate is stealing the ball. How can I stop my teammate from stealing the ball? And allow the enemy team to steal it. Localtion: http://prntscr.com/jnq732

function onTouched(hit)
if hit.Parent:FindFirstChild("Humanoid") ~= nil then
script.Parent.Parent=workspace
wait()
script.Parent.Parent=hit.Parent
script.Disabled = true
wait(2.5)
script.Disabled = false
end
end
script.Parent.Handle.touched:connect(onTouched)



1 answer

I would suggest adding a string value to the ball, when a player touches the ball, simply change the string to the color of the team that they are on. All you need to do after that is make sure the value of the string does not match the name of their team. I would add a script but I dont know how your studio is set up so sadly I cant. If you have any problems please leave a comment and I'll find the problem as soon as I can.

-Cmgtotalyawesome

This discussion is preserved as it was. New answers, comments, and votes are closed.