Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Tween Position With a gui? Error:Can only tween objects in the workspace.

Asked by
1lO_Ql1 -1
4 years ago

My gui is made to tween a notify gui but it will keep erroring with "Can only tween objects in the workspace". Can someone help me? Code:

script.Parent = nil
local HIPZ = Instance.new("ScreenGui")
local Notify = Instance.new("Frame")
local Title = Instance.new("TextLabel")
local Frame = Instance.new("Frame")
local Desc = Instance.new("TextLabel")
local Main = Instance.new("Frame")
local Name = Instance.new("TextLabel")
local Content = Instance.new("Frame")
local output = Instance.new("ScrollingFrame")
local TextLabel = Instance.new("TextLabel")
local input = Instance.new("TextBox")

-- Properties
HIPZ.Name = "HIPZ"
HIPZ.Parent = game.Players.LocalPlayer.PlayerGui
HIPZ.ZIndexBehavior = Enum.ZIndexBehavior.Sibling

Notify.Name = "Notify"
Notify.Parent = HIPZ
Notify.BackgroundColor3 = Color3.new(0.117647, 0.117647, 0.117647)
Notify.BorderSizePixel = 0
Notify.Position = UDim2.new(0.295187205, 0, 0, 0)
Notify.Size = UDim2.new(0, 387, 0, 95)

Title.Name = "Title"
Title.Parent = Notify
Title.BackgroundColor3 = Color3.new(1, 1, 1)
Title.BackgroundTransparency = 1
Title.BorderColor3 = Color3.new(0.772549, 0.772549, 0.772549)
Title.Size = UDim2.new(0, 387, 0, 26)
Title.Font = Enum.Font.Code
Title.Text = "Title"
Title.TextColor3 = Color3.new(1, 1, 1)
Title.TextSize = 14

Frame.Parent = Notify
Frame.BackgroundColor3 = Color3.new(1, 1, 1)
Frame.Position = UDim2.new(0, 0, 0.273684204, 0)
Frame.Size = UDim2.new(0, 386, 0, 0)

Desc.Name = "Desc"
Desc.Parent = Notify
Desc.BackgroundColor3 = Color3.new(1, 1, 1)
Desc.BackgroundTransparency = 1
Desc.Position = UDim2.new(0, 0, 0.273684204, 0)
Desc.Size = UDim2.new(0, 386, 0, 69)
Desc.Font = Enum.Font.Code
Desc.Text = "Desc"
Desc.TextColor3 = Color3.new(1, 1, 1)
Desc.TextSize = 14

Main.Name = "Main"
Main.Parent = HIPZ
Main.BackgroundColor3 = Color3.new(0.117647, 0.117647, 0.117647)
Main.Position = UDim2.new(0, 0, 0.673501611, 0)
Main.Size = UDim2.new(0, 417, 0, 187)

Name.Name = "Name"
Name.Parent = Main
Name.BackgroundColor3 = Color3.new(1, 1, 1)
Name.BackgroundTransparency = 1
Name.BorderSizePixel = 0
Name.Position = UDim2.new(0.791366875, 0, 0.43315506, 0)
Name.Rotation = 90
Name.Size = UDim2.new(0, 149, 0, 25)
Name.Font = Enum.Font.Code
Name.Text = "HIPZ - MENU - VERS"
Name.TextColor3 = Color3.new(1, 1, 1)
Name.TextSize = 14

Content.Name = "Content"
Content.Parent = Main
Content.BackgroundColor3 = Color3.new(1, 1, 1)
Content.BackgroundTransparency = 1
Content.Size = UDim2.new(0, 386, 0, 187)

output.Name = "output"
output.Parent = Content
output.BackgroundColor3 = Color3.new(1, 1, 1)
output.BackgroundTransparency = 1
output.BorderSizePixel = 3
output.Position = UDim2.new(0.0155440411, 0, 0.0320855603, 0)
output.Size = UDim2.new(0, 373, 0, 128)

TextLabel.Parent = output
TextLabel.BackgroundColor3 = Color3.new(1, 1, 1)
TextLabel.BackgroundTransparency = 1
TextLabel.Size = UDim2.new(0, 358, 0, 19)
TextLabel.Font = Enum.Font.SourceSans
TextLabel.Text = "test"
TextLabel.TextColor3 = Color3.new(0.180392, 1, 0)
TextLabel.TextSize = 14

input.Name = "input"
input.Parent = Content
input.BackgroundColor3 = Color3.new(1, 1, 1)
input.BackgroundTransparency = 1
input.Position = UDim2.new(0.0155440411, 0, 0.828877032, 0)
input.Size = UDim2.new(0, 373, 0, 21)
input.Font = Enum.Font.SourceSans
input.PlaceholderText = "Input"
input.Text = ""
input.TextColor3 = Color3.new(0.980392, 0.980392, 0.980392)
input.TextSize = 14
input.TextXAlignment = Enum.TextXAlignment.Left
----------------------------------------------------------------------------------------------------------
Notify.Position = UDim2.new(0.295187205, 0, -1, 0)
function notify(title, esc)
    local new = Notify:Clone()
    new.Position = Notify.Position
    new.Title.Text = title
    new.Desc.Text = esc
    new:TweenPosition(UDim2.new(0.295187205, 0, 0, 0),Enum.EasingDirection.In,Enum.EasingStyle.Back,.6,true, nil)
    wait(5)
    new:TweenPosition(UDim2.new(0.295187205, 0, -1, 0),Enum.EasingDirection.Out,Enum.EasingStyle.Back,.6,true, nil)
    new:Destroy()
end

wait(5)
notify("test","test")
0
Its for a friend. ;3 1lO_Ql1 -1 — 4y
1
BRUH JUST BUILD A CUSTOm GUI WITHOUT USING A SCRIPT AAAAAAA greatneil80 2647 — 4y

1 answer

Log in to vote
-1
Answered by 4 years ago

Try this

script.Parent = nil
local HIPZ = Instance.new("ScreenGui")
local Notify = Instance.new("Frame")
local Title = Instance.new("TextLabel")
local Frame = Instance.new("Frame")
local Desc = Instance.new("TextLabel")
local Main = Instance.new("Frame")
local Name = Instance.new("TextLabel")
local Content = Instance.new("Frame")
local output = Instance.new("ScrollingFrame")
local TextLabel = Instance.new("TextLabel")
local input = Instance.new("TextBox")

-- Properties
HIPZ.Name = "HIPZ"
HIPZ.Parent = game.Players.LocalPlayer.PlayerGui
HIPZ.ZIndexBehavior = Enum.ZIndexBehavior.Sibling

Notify.Name = "Notify"
Notify.Parent = HIPZ
Notify.BackgroundColor3 = Color3.new(0.117647, 0.117647, 0.117647)
Notify.BorderSizePixel = 0
Notify.Position = UDim2.new(0.295187205, 0, 0, 0)
Notify.Size = UDim2.new(0, 387, 0, 95)

Title.Name = "Title"
Title.Parent = Notify
Title.BackgroundColor3 = Color3.new(1, 1, 1)
Title.BackgroundTransparency = 1
Title.BorderColor3 = Color3.new(0.772549, 0.772549, 0.772549)
Title.Size = UDim2.new(0, 387, 0, 26)
Title.Font = Enum.Font.Code
Title.Text = "Title"
Title.TextColor3 = Color3.new(1, 1, 1)
Title.TextSize = 14

Frame.Parent = Notify
Frame.BackgroundColor3 = Color3.new(1, 1, 1)
Frame.Position = UDim2.new(0, 0, 0.273684204, 0)
Frame.Size = UDim2.new(0, 386, 0, 0)

Desc.Name = "Desc"
Desc.Parent = Notify
Desc.BackgroundColor3 = Color3.new(1, 1, 1)
Desc.BackgroundTransparency = 1
Desc.Position = UDim2.new(0, 0, 0.273684204, 0)
Desc.Size = UDim2.new(0, 386, 0, 69)
Desc.Font = Enum.Font.Code
Desc.Text = "Desc"
Desc.TextColor3 = Color3.new(1, 1, 1)
Desc.TextSize = 14

Main.Name = "Main"
Main.Parent = HIPZ
Main.BackgroundColor3 = Color3.new(0.117647, 0.117647, 0.117647)
Main.Position = UDim2.new(0, 0, 0.673501611, 0)
Main.Size = UDim2.new(0, 417, 0, 187)

Name.Name = "Name"
Name.Parent = Main
Name.BackgroundColor3 = Color3.new(1, 1, 1)
Name.BackgroundTransparency = 1
Name.BorderSizePixel = 0
Name.Position = UDim2.new(0.791366875, 0, 0.43315506, 0)
Name.Rotation = 90
Name.Size = UDim2.new(0, 149, 0, 25)
Name.Font = Enum.Font.Code
Name.Text = "HIPZ - MENU - VERS"
Name.TextColor3 = Color3.new(1, 1, 1)
Name.TextSize = 14

Content.Name = "Content"
Content.Parent = Main
Content.BackgroundColor3 = Color3.new(1, 1, 1)
Content.BackgroundTransparency = 1
Content.Size = UDim2.new(0, 386, 0, 187)

output.Name = "output"
output.Parent = Content
output.BackgroundColor3 = Color3.new(1, 1, 1)
output.BackgroundTransparency = 1
output.BorderSizePixel = 3
output.Position = UDim2.new(0.0155440411, 0, 0.0320855603, 0)
output.Size = UDim2.new(0, 373, 0, 128)

TextLabel.Parent = output
TextLabel.BackgroundColor3 = Color3.new(1, 1, 1)
TextLabel.BackgroundTransparency = 1
TextLabel.Size = UDim2.new(0, 358, 0, 19)
TextLabel.Font = Enum.Font.SourceSans
TextLabel.Text = "test"
TextLabel.TextColor3 = Color3.new(0.180392, 1, 0)
TextLabel.TextSize = 14

input.Name = "input"
input.Parent = Content
input.BackgroundColor3 = Color3.new(1, 1, 1)
input.BackgroundTransparency = 1
input.Position = UDim2.new(0.0155440411, 0, 0.828877032, 0)
input.Size = UDim2.new(0, 373, 0, 21)
input.Font = Enum.Font.SourceSans
input.PlaceholderText = "Input"
input.Text = ""
input.TextColor3 = Color3.new(0.980392, 0.980392, 0.980392)
input.TextSize = 14
input.TextXAlignment = Enum.TextXAlignment.Left
----------------------------------------------------------------------------------------------------------
Notify.Position = UDim2.new(0.295187205, 0, -1, 0)
function notify(title, esc)
    local new = Notify:Clone()
    new.Parent = HIPZ --//Gotta parent the clone to something, cannot tween an object with a parent value of nil
    new.Position = Notify.Position
    new.Title.Text = title
    new.Desc.Text = esc
    new:TweenPosition(UDim2.new(0.295187205, 0, 0, 0),Enum.EasingDirection.In,Enum.EasingStyle.Back,.6,true, nil)
    wait(5)
    new:TweenPosition(UDim2.new(0.295187205, 0, -1, 0),Enum.EasingDirection.Out,Enum.EasingStyle.Back,.6,true, nil)
    new:Destroy()
end

wait(5)
notify("test","test")
0
Thanks. 1lO_Ql1 -1 — 4y
0
No problem, glad I could help. CeramicTile 847 — 4y
Ad

Answer this question