Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

why transparency not changing ?

--- local script
local remote = game.ReplicatedStorage.Effect1

if game.Players.LocalPlayer.PlayerGui.Waitmove:WaitForChild("Logia") then
    print("Yah")
   remote:FireServer()
print("Yah1")
end

-- server
local remote = game.ReplicatedStorage.Effect1

remote.OnServerEvent:Connect(function()
game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        local arm1 = char["Right Arm"]
        
        arm1.Touched:Connect(function(hit)
            if hit then
                arm1.Transparency = 0.5
                
               end
           end)    
       end)
end)
end)

it prints Yah and Yah1 but transparency doesnt change pls help me lol

6 comments

0

Mind if you put prints at the remote? Tell me after that if it prints.

0

i tryed to print after the transparency part and diddnt work

0

Is your character R15 or R6

0

Tried using WaitForChild?

0

I just noticed you don't need player added and character added in your OnServerEvent because the player value is a parameter of OnServerEvent. In the () just put plr or player as a parameter, and for the character, just use plr.Character or whatever you have as the player parameter.

0

watch alvin blox with rainbow trail i think you need to specify the arm by using char.Player or something

1 answer

✓ Accepted answer

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:

local ReplicatedStorage = game:GetService("ReplicatedStorage");
local RemoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent");

RemoteEvent.OnServerEvent:Connect(function(player)
	-- "player" is the player who fired the remote
	print(player.Name, "just invoked a remote event in ReplicatedStorage :OO")
end)

This discussion is preserved as it was. New answers, comments, and votes are closed.