Hey, So i have been looking around the internet for ages trying to find a percentage system. I want a keycard to have a percentage of opening a door but all the things i found do not really work.

This is what i tried and it is probably horribly wrong but i am still learning:

script.Parent.Touched:Connect(function(hit)

		
       hit.Parent.Name == "FAKEKeycard" then
		math.random(1,10)
		if math.random == 3 then
		script.Parent.CanCollide = false
		script.Parent.Transparency = 0.5
		wait(2)
		script.Parent.CanCollide = true
		script.Parent.Transparency = 0
		end
		
	end
	

2 comments

0

you for got to put if before your statement in line 4.

0

forgot*