For my Roblox game I am creating a character selection GUI that allows the player to switch between multiple skillsets.
When attempting to tween the GUI to it’s given location I receive the error : Unable to cast to Dictionary - Client - LocalScript:12.
I have looked at multiple posts from other developers but overall have found no common error with any post.
Code - Located In StarterGUI
local CharacterSelectorEvent = game.ReplicatedStorage.CharacterSwitch:WaitForChild("CharacterSelect")
local CurrentClass = ""
script.Parent.Parent.MouseButton1Click:Connect(function()
if script.Parent.UIEnabled == false then
script.Parent.UIEnabled.Value = true
local TS = game:GetService("TweenService"):Create(script.Parent, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {Size = 0, 149,0, 135})
local TS2 = game:GetService("TweenService"):Create(script.Parent.UIGridLayout, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {CellSize = 0,150,0,40})
TS:Play()
TS2:Play()
elseif script.Parent.UIEnabled.Value == true then
local TS3 = game:GetService("TweenService"):Create(script.Parent, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {Size = 0, 149,0, 0})
local TS4 = game:GetService("TweenService"):Create(script.Parent.UIGridLayout, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {CellSize = 0,150,0,0})
script.Parent.UIEnabled.Value = false
TS3:Play()
TS4:Play()
end
end)
for i,v in pairs(script.Parent:GetChildren()) do
if v:IsA("TextButton") then
v.MouseButton1Click:Connect(function()
for i2,v2 in pairs(game.ReplicatedStorage.Accessories:GetChildren()) do
if v2.Name.."Button" == v.Name then
local Player = script.Parent.Parent.Parent
local Character = Player.Character
if Character.Humanoid.Health == Character.Humanoid.MaxHealth then
Player:LoadCharacter()
CurrentClass = v2.Name
wait(1)
for i3, v3 in pairs(v2:GetChildren()) do
v3.Tools:Clone().Parent = Player.Backpack
local TS5 = game:GetService("TweenService"):Create(script.Parent.KojiroButton, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {Size = 0, 149,0, 0})
local TS6 = game:GetService("TweenService"):Create(script.Parent.BuddahButton, TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out), {CellSize = 0,150,0,0})
script.Parent.UIEnabled.Value = false
wait(1)
TS5:Play()
TS6:Play()
end
end
end
end
end)
end
end