I've been trying to make a portal you can go through only by paying ONCE. I've been at this for an hour but no luck. Hoping someone here can answer. Here is my code:
function onTouch(part)
if part.Parent.Humanoid ~=nil then
part.Parent:MoveTo(workspace.Spawns["Area 3"]["Area 3 Spawn"].Position)
script.Parent.Parent.SpawnTo3.Script.Disabled = true
wait(2)
script.Parent.Parent.SpawnTo3.Script.Disabled = false
end
end
script.Parent.Touched:connect(onTouch)

3 comments
Data is not a valid member of Player "Players.agentgamer100" sorry im a beginneer what do i do about this?
oh. you need to make the datastore first. also, it wouldnt be player.Data. (just using that as an example) I use profileservice so i would do something like require(PATH_TO_MODULE)[player].Data.Portal1
there are other ways to make data. just edit the one part to match how your data is set up. I dont think im allowed to just give full scripts here bc it usually gets deleted for some reason.