01 | --- local script |
02 | local remote = game.ReplicatedStorage.Effect 1 |
03 |
04 | if game.Players.LocalPlayer.PlayerGui.Waitmove:WaitForChild( "Logia" ) then |
05 | print ( "Yah" ) |
06 | remote:FireServer() |
07 | print ( "Yah1" ) |
08 | end |
09 |
10 | -- server |
11 | local remote = game.ReplicatedStorage.Effect 1 |
12 |
13 | remote.OnServerEvent:Connect( function () |
14 | game.Players.PlayerAdded:Connect( function (plr) |
15 | plr.CharacterAdded:Connect( function (char) |
it prints Yah and Yah1 but transparency doesnt change pls help me lol
Your script is not working as you are not running the code until a player joins the game. When a player fires (or invokes) a remote event or remote function, the first argument of the callback is the player.
Example:
1 | local ReplicatedStorage = game:GetService( "ReplicatedStorage" ); |
2 | local RemoteEvent = ReplicatedStorage:WaitForChild( "RemoteEvent" ); |
3 |
4 | RemoteEvent.OnServerEvent:Connect( function (player) |
5 | -- "player" is the player who fired the remote |
6 | print (player.Name, "just invoked a remote event in ReplicatedStorage :OO" ) |
7 | end ) |