Hello everyone! I am trying to make a command when you say !Handto, a Frame will show up playing a tween. But its not it’s playing and the Frame won’t pop up.
Script
local GroupId = 7446763
local MinimumRank = 4
game.Players.PlayerAdded:COnnect(function(PLayer)
Player.Chatted:Connect(function(Message)
if Player:GetRankInGrouo(GroupId) >= MinimumRank then
local Command = PLayer.PlayerGui.HandtoGui.Frame
if Message == "!Handto" then
wait(1)
Command:TweenPosition(UDim2.new(0.5, 0,0.1, 0), 'Out', 'Bounce', '1')
elseif Message == "!Close" then
Command:TweenPosition(UDim2.new(0.5, 0,-1, 0), 'Out', 'Bounce', '1')
end
end
end)
end)
So, I did everything. but it still doesn’t work. Here’s the script, I might’ve made a typo again
local GroupId = 7446763
local MinimumRank = 4
local Commands = script.Parent.Frame
game.Players.PlayerAdded:Connect(function(Player)
Player.Chatted:Connect(function(Message)
if Player:GetRankInGroup(GroupId) >= MinimumRank then
local Command = Player.PlayerGui.HandtoGui.Frame
if Message == "!Handto" then
Commands:TweenPosition(UDim2.new(0.5, 0,0.1, 0), 'Out', 'Bounce', 1)
:Play()
elseif Message == "!Close" then
Commands:TweenPosition(UDim2.new(0.5, 0,-1, 0), 'Out', 'Bounce', 1)
:Play()
end
end
end)
end)
Just add :Play() to the end of these lines like I did in this example, they should be on the same one. If this doesn’t solve it, are there any output errors?
If your frame isn’t being tweened the problem could just be that you need to wait until the ui exists. Also from what I know I always tween frames using localscripts. It may not work with server scripts.
local GroupId = 7446763
local MinimumRank = 4
game.Players.PlayerAdded:Connect(function(Player)
Player.Chatted:Connect(function(Message)
if Player:GetRankInGroup(GroupId) >= MinimumRank then
local Command = Player.PlayerGui.HandtoGui.Frame
if Message == "!Handto" then
Command:TweenPosition(UDim2.new(0.5, 0,0.1, 0), 'Out', 'Bounce', 1, true)
elseif Message == "!Close" then
Command:TweenPosition(UDim2.new(0.5, 0,-1, 0), 'Out', 'Bounce', 1, true)
end
end
end)
end)
I assume your doing this in a server script. At the part of tweening, change the script to local script, because GUI ONLY TAKES EFFECT on local, bot server.