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

How do I make a restricted door that only people with a certain amount of points can go through?

I want to create a game where you fight people to get points. After you get a certain amount of points you can go to different rooms with more weapons. I don’t want it to be like a shop where you actually spend your points, I want people to keep their points.

1 answer

insert this script inside of the door part make an IntValue inside of the door part which contains the amount of points required to pass through the door

script.Parent.Touched:connect(function(a)
	local plr = game.Players.GetPlayerFromCharacter(a)
	if plr then
		local pts = plr.FindFirstChild("Points",true).Value
		local minimumpts = script.Parent:FindFirstChildWhichIsA("IntValue",true).Value
		if pts >= minimumpts then
			script.Parent.CanCollide = false
		else
			script.Parent.CanCollide = true
		end
	end
end)

1 comment

0

Thanks

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