I know this is not a very efficient way of making GUI’s but, when I try to tween, as you can see at the bottom, it says ‘Can only tween objects in workspace’. This error only happens at another place, not my original testing place. Any idea why this is happening? (I’ve removed the remote event firing/command that executes it and I can assure you at works)
-- Instances:
local raidDetectedGUI = Instance.new("ScreenGui", game.StarterGui)
local raidDetectedText = Instance.new("TextLabel", raidDetectedGUI)
local frameBackground = Instance.new("ImageLabel", raidDetectedGUI)
--Properties:
raidDetectedGUI.Archivable = false
raidDetectedGUI.Name = "raidDetectedGUI"
raidDetectedGUI.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
raidDetectedText.Name = "raidDetectedText"
raidDetectedText.Parent = raidDetectedGUI
raidDetectedText.BackgroundColor3 = Color3.new(1, 1, 1)
raidDetectedText.BackgroundTransparency = 1
raidDetectedText.Position = UDim2.new(1, 475, 0, 150)
raidDetectedText.Size = UDim2.new(0, 730, 0, 20)
raidDetectedText.ZIndex = 2
raidDetectedText.Font = Enum.Font.SciFi
raidDetectedText.Text = " dssdfsdfsdsdfsdfsdfsdsdf "
raidDetectedText.TextColor3 = Color3.new(1, 0, 0)
raidDetectedText.TextScaled = true
raidDetectedText.TextSize = 14
raidDetectedText.TextWrapped = true
frameBackground.Name = "frameBackground"
frameBackground.Parent = raidDetectedGUI
frameBackground.Active = true
frameBackground.BackgroundColor3 = Color3.new(1, 1, 1)
frameBackground.BackgroundTransparency = 1
frameBackground.Position = UDim2.new(1, 500, 0, 130)
frameBackground.Size = UDim2.new(0, 680, 0, 60)
frameBackground.Image = "rbxgameasset://Images/us"
raidDetectedGUI.Enabled = true
detectRaid.OnClientEvent:Connect(function(msg)
raidDetectedText:TweenPosition(UDim2.new(0, 475, 0, 150), "In", "Linear", 1.1)
frameBackground:TweenPosition(UDim2.new(0, 500, 0, 130), "In", "Linear", 1.1)
raidDetectedText.Text = msg
wait(6)
raidDetectedText:TweenPosition(UDim2.new(1, 475, 0, 150), "In", "Linear", 1.1)
frameBackground:TweenPosition(UDim2.new(1, 500, 0, 130), "In", "Linear", 1.1)
end)