My code is not working. I’ve tried to Tween the Position back to Its original position and it keeps multiplying the position and moving in random places. I also have tried using a regular old Frame.Position code, which isn’t moving the frame at all. Not sure what the issue is here. But It’s really a pain.
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function()
if player.PlayerGui:FindFirstChild("Menu") then
player.PlayerGui.Menu.Frame.Visible = true
player.PlayerGui.Menu.Frame:TweenPosition(UDim2.new(0, 0, 0, 0),"InOut","Sine",0.5)
end
if not player.PlayerGui:FindFirstChild("Menu") then
local Clone = script.Menu:Clone()
Clone.Parent = player.PlayerGui
Clone.Frame.Visible = true
end
end)
end)
So what I see here are many things wrong, so you’re detecting when a player has been added to the game, here’s what is a little bit wrong is that each time a player has been added to the game it’ll do the same thing for the player that has already been inside the game and has passed the UI tweening and all that good stuff.
One thing you shouldn’t place it in character added event, but in player added and second scripts from server script service can’t access player gui and do any changes, for example tween position. Also why aren’t you just placing that gui into starter gui? Oh and tweens from server are using heartbeat and they lag, so do it on the client.
Thanks. I’m doing it from a CharacterAdded event because every time the player resets I’m giving the person a GUI without using ResetOnSpawn. This is because I’m trying to make a way to change the GUI without having ResetOnSpawn interfear, but also have it appear on spawn.
Also last I checked, you want to be doing this on the client, it’s not smart to do this on the server as it will cause many issues and possibly not work at all.