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.
COMMUNITY QUESTION
How do I make a restricted door that only people with a certain amount of points can go through?
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)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Thanks