Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 6 years ago
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!

0
is this in a localScript? theCJarmy7 1293 — 6y
0
no MustangHeart 67 — 6y
0
If it's in a serverScript, it will have change the dorr to canCollide false for everybody in the game theCJarmy7 1293 — 6y
0
now it doesnt let anyone in MustangHeart 67 — 6y
0
please help MustangHeart 67 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

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!

0
Accept answer if it helped. DaWarTekWizard 169 — 6y
0
oof just realized that LocalScripts can't change values, fire a remoteevent for that DaWarTekWizard 169 — 6y
0
They can change values, but only locally theCJarmy7 1293 — 6y
Ad

Answer this question