I am trying to tween a Frame's position for everyone.
Here is the local script in the client
`local repStore = game:GetService("ReplicatedStorage") local remote = repStore:WaitForChild("cool") f = game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame
remote.OnClientEvent:connect(function() f:TweenPosition(UDim2.new(1, 0, 0, 0), 'Out', 'Linear', 1)
end)`
Here is the script in Serverscriptservice
`local repStore = game:GetService("ReplicatedStorage") local remote = repStore:WaitForChild("cool")
button = game:GetService("StarterGui").ScreenGui.Frame.TextButton
button.MouseButton1Click:connect(function() remote:FireAllClients() end)
`
My remoteevent is in ReplicatedStorage named 'cool'
All that it's suppose to do is, when i click a button the frame moves to the otherside of the screen, and EVERYONE can see it move
StarterGui is what clones to the PlayerGui when a player joins, so you cant edit that. Also you cant enter the playergui with a server script. So, you have to insert a localscript, do
also insert a second remoteevent to the replicatedstorage, maybe called "cool2"
local repStore = game:GetService("ReplicatedStorage") local remote = repStore:WaitForChild("cool") button = script.Parent button.MouseButton1Click:connect(function() remote:FireServer() end)
remote script:
game.ReplicatedStorage.cool.OnServerEvent:Connect(function(plr) game.ReplicatedStorage.cool2:FireAllClients(plr) end)
cool2 remote script:
game.ReplicatedStorage.cool2.OnClientEvent:Connect(function() local plr = game.Players.LocalPlayer -- whatever script end)
I know the answer i gave you is pretty dumb, but i hope it helped.