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

How do I datastore a spawn based on touching a SpawnLocation?

Asked by 4 years ago
Edited 4 years ago

This is the code i got at the moment, I have others teams in my game and i dont want the prisonners datastore to store the other teams too (i need the prisoners to remain in prison even if they leave, and they only can get out of prison if we take them out of it)

local DataStoreService = game:GetService("DataStoreService")
local SpawnData = DataStoreService:GetDataStore("PlayerSpawn")
local part = game.Workspace.SpawnLocation

local function onTouched(HumanoidRootPart)



end

part.Touched:Connect(onTouched)

Answer this question