So i am using datastores2 to get a value and set it as the contents of a button. This works, except when i click Stop (in playtest mode), it breaks roblox studio completely.
Script:
local ReplicatedStorage = game:GetService("ReplicatedStorage") local ServerScriptService = game:GetService("ServerScriptService") local DataStore2 = require(ServerScriptService.DataStore2) function settext() local pointsStore = DataStore2("points", script.Parent.Parent.Parent.Parent.Parent) -- This is what seems to be the issue, found that out by commenting the 2 lines below this and the error still apears... script.Parent.Text="Points: " .. pointsStore:Get(100) pointsStore:Increment(1) end script.Parent.MouseButton1Click:Connect(settext)
Images:
StarterGUI Structure: https://gyazo.com/bf78e96d18b06b445e16b8b0a7527403
Error:
https://gyazo.com/c1242750b3466fd77ef154c562e1c6f9
https://gyazo.com/f0e87826129fab50bfed4d5c6a7ebbca
EDIT: Seems like the latest Roblox Studio update fixed this :D