My god, thank you. I was thinking it was something like that.
I don’t think .Touched works if someone is noclipping.
What would be filled out here?
You do not need the script to be this complex you just need:
local part = whereeverthepartis
part.Touched:Connet(function(hit)
if hit:FindFirstChild("Humanoid") then
local root = hit:FindFirstChild("HumanoidRootPart")
root.CFrame = CFrame.new(teleport position)
end)
This might be a late reply, but I did what yours says, and I the script will not work for me. I put this in the Zone script.
You have to put it in a server script, not in the zone’s module, in fact, you don’t need the zone module in your game at all. You don’t have to check for a humanoid either.
This should work:
zone.playerAdded:Connect(function(player)
if MPS:UserOwnsGamepassAsync(--[[gamepass id goes here]], player.UserId) == false then
workspace[player.Name]:BreakJoints()
end
end)
You also have to make a model/folder with the parts you want and put it in the group section at the ‘local zone’ at the top.
I am on my phone so I’m not sure if it will work but it should.
You could also use the .Touched method, however I don’t think it works with no clip. An exploiter could also just delete the part and the server doesn’t register the .Touched events if I recall correctly, which is why this method is optimal.
So you don’t need to use Zone+. You can just insert that script. Thank god. Thank you!
Though would I have to put the part piece in the Server Script Storage?
OR
Would you put it like this?
You still need the top part with the local variables.
So this?
I’ve made a model for you here, I’ve added quite a few comments so you can tell what’s going on.
CheckGamepass.rbxm (4.1 KB)
Do I open this up in Studio because it doesn’t let me. It leads me to one of the sites I use called Express Zip.
Yeah, you should be able to just drag it into studio as it’s an rbxm file.
I added it to the game. Though why is there two parts and another part? Shouldnt it be just one? Plus, do I just add a script to these?
Nvm found script
Yeah, unless you’re changing the heritage of the folder.
There are 2 parts, the names are something like this: DoesOwn, the player will be teleported there if they own the gamepass, and DoesntOwn, the player will be teleported there if they don’t own it. You could also modify the if statement if you don’t want both parts. The middle part is where it checks every player inside of that part, and determines if the player is teleported to the DoesOwn part, or the DoesntOwn part.
Say this is the game pass area. Would I put all these parts together or leave some out. Plus do I scale the parts to where it should be around the area? Plus, most people get in by glitching through the door. When a user touching one of these parts, would it react if they have the game pass and not. So if a user went in and owned it, and touches one of these parts, he or she will be allowed in. While if they don’t and glitch in, they’ll be teleported if touched.
You would want to have the middle part fill up the entire thing as a giant box, just set its transparency to 1, it would check whether each player owns the gamepass or not. The DoesntOwn part goes outside of the gamepass area. You can delete the DoesOwn part and change the if statement to
if UserOwnsGamepass == false then
workspace[player.Name]:MoveTo(workspace.DoesNotOwn.Position)
end
And that’s all. It will just teleport the player to the DoesNotOwn part.