Is there a way to use SavePlaceAsync() that doesn't return errors?
Asked by
6 years ago Edited 6 years ago
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] [It is not a group game]
01 | local ReplicatedStorage = game:GetService( "ReplicatedStorage" ) |
02 | 02 local saveWorldEvent = Instance.new( "RemoteEvent" , ReplicatedStorage) |
03 | 03 saveWorldEvent.Name = "SaveWorldEvent" |
04 | 04 local canSave = game.ServerStorage.canSave |
06 | 06 function savePlace(player) |
07 | 07 print ( "Save Requested" ) |
08 | 08 if canSave.Value = = true then |
09 | 09 game:GetService( "AssetService" ):SavePlaceAsync() |
10 | 10 canSave.Value = false |
11 | 11 local chat = game:GetService( "Chat" ) |
12 | 12 chat:Chat(script.Parent, "Saving World" ) |
13 | 13 print ( "World Saving" ) |
15 | 15 chat:Chat(script.Parent, "World Saved" ) |
16 | 16 print ( "World Saved" ) |
18 | 18 canSave.Value = true |
19 | 19 elseif canSave.Value = = false then |
20 | 20 local chat = game:GetService( "Chat" ) |
21 | 21 chat:Chat(script.Parent, "Please wait, worlds can only be saved once every 20 seconds." ) |
22 | 22 print ( "Can not save during cooldown." ) |
26 | 26 saveWorldEvent.OnServerEvent:Connect(savePlace) |