-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestjson
More file actions
48 lines (42 loc) · 1.29 KB
/
testjson
File metadata and controls
48 lines (42 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
function loadcheck()
if isfile("SalunaCFrame.json") then
g = readfile("SalunaCFrame.json")
return g
else
writefile("SalunaCFrame.json",game:GetService("HttpService"):JSONEncode(getgenv().CFrame))
return
end
end
getgenv().CFrame = {
["Position X"] = "",
["Position Y"] = "",
["Position Z"] = ""
function LoadSetting()
if isfile("SalunaCFrame.json") then
vb = game:GetService("HttpService"):JSONDecode(readfile("SalunaCFrame.json"))
getgenv().CFrame = vb
return vb
else
loadcheck()
return
end
end
function SaveSetting()
if isfile("SalunaCFrame.json") then
f = writefile
writefile("SalunaCFrame.json",game:GetService("HttpService"):JSONEncode(getgenv().CFrame))
return f
else
loadcheck()
return
end
end
loadcheck()
LoadSetting()
local myCFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.Position
getgenv().CFrame = {
["Position X"] = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.Position.X,
["Position Y"] = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.Position.Y,
["Position Z"] = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.Position.Z
}
SaveSetting()