I want to save the place when the remote event is called. Currently I get the error HTTP 403 (HTTP/1.1 403 Forbidden) [Yes I am testing in-game not in studio] [Yes 'Allow this place to be copied as a template using the Create Place API in your game.' and 'Allow this place to be updated using the Save Place API in your game.' are enabled.] [Yes this is a server script] [The script is in ServerScriptService]
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local saveWorldEvent = Instance.new("RemoteEvent", ReplicatedStorage)
saveWorldEvent.Name = "SaveWorldEvent"
local canSave = game.ServerStorage.canSave
function savePlace(player)
print("Save Requested")
if canSave.Value == true then
game:GetService("AssetService"):SavePlaceAsync()
canSave.Value = false
local chat = game:GetService("Chat")
chat:Chat(script.Parent, "Saving World")
print("World Saving")
wait(3)
chat:Chat(script.Parent, "World Saved")
print("World Saved")
wait(17)
canSave.Value = true
elseif canSave.Value == false then
local chat = game:GetService("Chat")
chat:Chat(script.Parent, "Please wait, worlds can only be saved once every 20 seconds.")
print("Can not save during cooldown.")
end
end
saveWorldEvent.OnServerEvent:Connect(savePlace)
