I'm struggling for searching for sharing my script to other place i saw some people said that data store is needed to pass it to other place but i already do it and also check the Enable Studio Access to API Services but still its not working so is anyone have an idea how other do that or where they get the information to do it?
local datastore = game:GetService("DataStoreService"):GetDataStore("experiment-datastore") local Statsfolder = script.Stats game.Players.PlayerAdded:Connect(function(newplayer) local key = "Player-ID:"..newplayer.UserId local GetSave = datastore:GetAsync(key) local newStatsfolder = Instance.new("Folder",newplayer) newStatsfolder.Name = "leaderstats" for i,Stats in pairs(Statsfolder:GetChildren())do local newStats = Instance.new(Stats.ClassName) newStats.Name = Stats.Name newStats.Value = Stats.Value newStats.Parent = newStatsfolder end if GetSave then for i,Stats in pairs(script.Stats:GetChildren())do newStatsfolder[Stats.Name].Value = GetSave[i] print(i,Stats.Name,Stats.Value) end else local StatsToSave = {} for i,Stats in pairs(newStatsfolder:GetChildren())do table.insert(StatsToSave,Stats.Value) print(i,Stats.Name,Stats.Value) end datastore:SetAsync(key, StatsToSave) end while wait(30) do local StatsToSave = {} for i,Stats in pairs(newStatsfolder:GetChildren())do table.insert(StatsToSave,Stats.Value) print(i,Stats.Name,Stats.Value) end datastore:SetAsync(key,StatsToSave) end game.Players.PlayerRemoving:Connect(function(oldplayer) local key = "Player-ID:"..oldplayer.UserId local StatsToSave = {} for i,Stats in pairs(newStatsfolder:GetChildren())do table.insert(StatsToSave,Stats.Value) print(i,Stats.Name,Stats.Value) end datastore:SetAsync(key,StatsToSave) end) end) this is the script and its working but it can't be sent to my other place
script.Parent.MouseButton1Click:Connect(function() game:GetService("TeleportService"):Teleport(2805605031,game.Players.LocalPlayer) end) and here is my teleportservice script and i dont know what to add