I don't know what I need to do in order for this to work, help would be appreciated, I am trying to see if the player who clicked on the play gui button has any data stored in a data storage location. If they don't I want to teleport them to a tutorial place, but when I click the play button nothing happens
Error:
19:38:50.304 - 502: API Services rejected request with error. HTTP 403 (Forbidden) 19:38:50.305 - Stack Begin 19:38:50.306 - Script 'ServerScriptService.Script', Line 12 19:38:50.306 - Stack End
Local Script:
--Variables
local camera = workspace.CurrentCamera
local camPart = workspace.maincam
local frame = script.Parent:WaitForChild("Frame")
local PlayBtn = frame:WaitForChild("Play Button")
local Credits = frame:WaitForChild("Credits")
local Title = frame:WaitForChild("Title")
local GamePopup = script.Parent:WaitForChild("Loadingtxt")
local repstorage = game:GetService("ReplicatedStorage")
local event = repstorage:WaitForChild("noob")
spawn(function()
camera.CameraType = "Scriptable"
camera.CFrame = camPart.CFrame
frame.Visible = true
end)
PlayBtn.MouseButton1Click:Connect(function()
GamePopup.Visible = true
local player = game.Players.LocalPlayer
event:FireServer(player)
end)
Server Script:
local DataStoreService = game:GetService("DataStoreService")
local tpService = game:GetService("TeleportService")
local Tutorial = 4653251860
local Playground = ...
local newplayer = DataStoreService:GetDataStore("NoobCheck")
local repstorage = game:GetService("ReplicatedStorage")
local event = repstorage:WaitForChild("noob")
local function checkplayer(player)
local check
check = newplayer:GetAsync(player.UserId.."-test")
if(check == nil)then
tpService:Teleport(Tutorial,player.UserId)
else
tpService:Teleport(Playground,player.UserId)
end
end
event.OnServerEvent:Connect(checkplayer)

3 comments
is there a way I can fix this then?
or can you please elaborate more?
Sure, make the owner do fix this problem meaning he will need to enable datastores