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

Is TweenPosition broke or something? My script will not working for some reason.

Asked by 7 years ago

My TweenPosition script is not working and I have no idea why.

function hide(name)
    name:TweenPosition(UDim2.new(0, 0, 1, -50), 'Out', 'Bounce', 1)
end


script.Parent.Parent.Players.PlayerAdded:connect(function(player)
    local SMGuiC = script.Parent.Parent.ServerStorage:WaitForChild("SMGui"):Clone()
    local smtext = SMGuiC:WaitForChild("SM").SMText
    smtext.Text = "You joined the server with Rank "..player:GetRankInGroup(3583996)
    SMGuiC.Parent = script.Parent.Parent.StarterGui
    SMGuiC.SM.Visible = true
    wait(3)
    print("you got mail")
    hide(SMGuiC.SM)
    wait(1)
end)
0
You don't exactly use hide() in this script... u make it a function and name isn't really defined greatneil80 2647 — 7y
0
Do you know how functions work? hiimgoodpack 2009 — 7y

1 answer

Log in to vote
0
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
7 years ago

The server doesn't have access to the PlayerGui if FE is on. Do this on the client.

LocalScript in theSMText component of the gui. Place the gui in StarterGui.

local player = game.Players.LocalPlayer
local smtext - script.Parent

function hide(name)
    name:TweenPosition(UDim2.new(0, 0, 1, -50), 'Out', 'Bounce', 1)
end

smtext.Text = "You joined the server with Rank "..player:GetRankInGroup(3583996)
wait(3)
print("you got mail")
hide(smtext.Parent)
Ad

Answer this question