I have one script which opens a GUI and that works perfectly, so, I thought it would be a good idea to just copy that identical script into my GUI and change the sizes. However, the second script doesn’t work whereas the first script does and I get some strange errors relating to GUIs when loading into the game (Already asked a question about this but didn’t seem to get an answer). The question is mainly about what the errors are in my game, but it’s also a check to see if I have made a mistake in my code.
Here is the screenshot of the errors which are shown when joining: https://gyazo.com/adfc270e8c6f78f05f5850a3a7180456
Here is the code:
-- // variables //
local MainFrame = script.Parent.MainFrame
local Close = script.Parent.Open
-- // functions //
local function OpenGui()
MainFrame.Visible = true
MainFrame.AnchorPoint = Vector2.new(0.5,0.5)
MainFrame:TweenSize(UDim2.new(0.474, 0,0.58, 0), Enum.EasingDirection.In, Enum.EasingStyle.Sine, 0.2)
end
local function CloseGui()
MainFrame.AnchorPoint = Vector2.new(0.5,0.5)
MainFrame:TweenSize(UDim2.new(0, 0, 0, 0), Enum.EasingDirection.In, Enum.EasingStyle.Sine, 0.2)
wait(0.2)
MainFrame.Visible = false
end
-- // events //
script.Parent.Open.MouseButton1Click:Connect(function()
if MainFrame.Size == UDim2.new(0.474, 0, 0.58, 0) then
CloseGui()
else
OpenGui()
end
end)
Close.MouseButton1Click:Connect(CloseGui)
I did have a sudden dealing with a studio virus, so there may still be remnants of the virus which I am still not sure about. However, simply just moving place would not be ideal at all, as I have data that is saved on data stores. I have not used any free models if you’re wondering, and all of my plugins are from trusted developers. This makes me question about where they have come from.
This was the beginning of a malicious script that I found (I can’t post the whole thing as it was on one line) which I managed to remove as it was teleporting me to a different place, this issue was resolved by simply deleting the script.
EDIT 2: I have noticed that when joining the game, it seems to show as if my character is taking damage and the screen flashes red for a fraction of a second.