Tween not playing

I know, but I said to check for output errors and you said there weren’t any. Could just be a mistake.

1 Like

I am not. It’s a local script in the ScreenGui

I’m not really sure what you’re trying to do, but if that doesn’t work I suggest using a local script, and firing the client when a player joins. The script firing the client would be in serverscriptservice so it’s only 1 script ingame managing that type of thing.

Here’s an example of how it would look;

-- server script (goes in serverscriptservice)

local GroupId = 7446763 
local MinimumRank = 4
local Remote = game.ReplicatedStorage.ChattedRemote

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
				Remote:FireClient(Player, Message)
			elseif Message == "!Close" then
				Remote:FireClient(Player, Message)
			end
		end
	end)
end)

-- LocalScript (where the previous script you used goes)

local Remote = game.ReplicatedStorage:WaitForChild("ChattedRemote")
local Player = game.Players.LocalPlayer
local gui = Player.PlayerGui
local HandToGui = gui:WaitForChild("HandToGui")
local Command = HandToGui:WaitForChild("Frame")
Remote.OnClientEvent:Connect(function(Message)
	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)
1 Like

Yea, use remote events. Or remove functions.

If you Are making a list of commands, I recommend you not to use the if statements to see if the player chatted a command, instead, create an empty list and store all the commands inside. Then, make the script to check the first part of the word in the message from the player, if it’s a valid command, use if statements and call that function. This idea is from alvinBlox’s tutorial about creating admin commands. Hope this helps!