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

tween error | attempt to index boolean with 'Play' ?

Asked by 3 years ago

Alright so i've browsed a bit after this issue and the only thing i could find was to rename my "JoinScreenAnimation" and that didn't work. Then a second issue where it doesnt disable the chat but it does disable the leaderboard.Here's my code:

local ReplicatedFirst = game:GetService("ReplicatedFirst")
ReplicatedFirst:RemoveDefaultLoadingScreen()
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat,false) --this does disable the leaderboard
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList,false) --this does not disable the chat

wait(10)
if not game:IsLoaded() then
    game.Loaded:Wait()
end

script.Parent.JoinScreen.Loading.Visible = false
script.Parent.JoinScreen.Loaded.Visible = true
wait(0.5)
local JoinScreenAnimation = script.Parent.JoinScreen.TitleCard:TweenPosition(UDim2.new(0,0,0,0), Enum.EasingDirection.In, Enum.EasingStyle.Linear, 2, true )

JoinScreenAnimation:Play() --[[error Players.Pitched_mobile.PlayerGui.ScreenGui.ScreenHandler:16: attempt to index boolean with 'Play']]

JoinScreenAnimation.Completed:Connect(function()
    wait(2)
    script.Parent.JoinScreen:Destroy()
    script.Parent.Select.Visible = true
    game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList,true)
    game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Chat,true)
end)
0
Must be something stupid im overlooking here Pitched_mobile 191 — 3y

1 answer

Log in to vote
1
Answered by 3 years ago

:TweenPosition returns a boolean of whether the GUI will be tweened or not. You don't need to use :Play() with :TweenPosition(), as it will attempt to tween the GuiObject regardless. You should try using TweenService:Create() instead.

local JoinScreenAnimation = TweenService:Create(script.Parent.JoinScreen.TitleCard, TweenInfo.new(2, Enum.EasingStyle.Linear, Enum.EasingDirection.In), {Position = Udim2.new(0, 0, 0, 0)
JoinScreenAnimation:Play()
0
oh so it will just play Pitched_mobile 191 — 3y
0
Yes, but you won't be able to have the .Completed event if my memory is correct virushunter9 943 — 3y
0
yeah gotcha Pitched_mobile 191 — 3y
1
yeah gotcha i just fixed it with adding a Wait() Pitched_mobile 191 — 3y
Ad

Answer this question