local Prompt = script.Parent
local Display = script.Parent.Parent.SurfaceGui.Display
Prompt.Triggered:Connect(function(Plr)
if Plr.leaderstats.Money.Value >= 7 then
Prompt.MaxActivationDistance = 0
Plr.leaderstats.Money.Value -= 7
Display.Text = Plr.Name.." is playing..."
ball.Anchored = false
wait(10)
ball.Anchored = true
ball.Touched:Connect(function(Color)
print("Ball hit")
if Color:IsA("MeshPart") then
if Color.Name == "Red" then
print("Red")
elseif Color.Name == "Green" then
print("Green")
elseif Color.Name == "Blue" then
print("Blue")
else
print("Error no color")
end
end
end)
wait(3)
ball.Position = Vector3.new(-84.65, 6.801, -226.016)
Prompt.MaxActivationDistance = 4
Display.Text = "$7 to play."
else
end
end)
Everything is working with this code except the “ball.Touched” never gets set off I even put a print there to see if it was getting set off but it’s not even printing that, no errors nothing, but I’m trying to get the ball to detect if it hits another part. What do I do? Or what’s wrong with this code?