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

Door lets everyone in, not just people of a certain rank in the group?

local groupid = 3897722

game.Players.PlayerAdded:Connect(function(player)
	if player:GetRankInGroup(groupid) >= 249 then
		script.Parent.CanCollide = false
		script.Parent.Parent.card.Value = true
	end
end)

Help!

5 comments

0

is this in a localScript?

0

no

0

If it's in a serverScript, it will have change the dorr to canCollide false for everybody in the game

0

now it doesnt let anyone in

0

please help

1 answer

✓ Accepted answer

Hi there! You changed it to a localscript according to the comments. Local scripts don't work in the workspace. They only work in the Player service, tools with exceptions, and the replicated storage I think. There's an easy fix to your issue.

I have no idea what the hierarchy or name of script.Parent is so for this example, we will use workspace.Part.PartChild. Change it to whatever yours is.

Make sure the script below is a local script.

local groupid = 3897722

game.Players.PlayerAdded:Connect(function(player)
    if player:GetRankInGroup(groupid) >= 249 then
        workspace.Part.PartChild.CanCollide = false
        workspace.Part.card.Value = true
    end
end)

Make sure the above script is in the StarterCharacterScripts or the StarterGui.

Good luck!

3 comments

0

Accept answer if it helped.

0

oof just realized that LocalScripts can't change values, fire a remoteevent for that

0

They can change values, but only locally

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