Hello, I am currently having a “problem” with RemoteEvents. In the gif below you can find out what I mean, what I am trying to achieve is so it just makes my Character invisible, nothing else.
Please use the snipping tool on your computer I do not trust links
Could you send the scripts please?
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(plr,Event)
if Event == 'Invis' then
for _, i in pairs(plr.Character:GetDescendants()) do
if i:IsA("BasePart") and i.Name ~= 'HumanoidRootPart' then
i.Transparency = .4
end
end
elseif Event == 'Vis' then
for _, i in pairs(plr.Character:GetDescendants()) do
if i:IsA("BasePart") and i.Name ~= 'HumanoidRootPart' then
i.Transparency = 0
end
end
end
end)
What does fire that event?
Screenshot pls
Apologies for the delay. Here is the script I use:
Client:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = ReplicatedStorage:WaitForChild("Events"):WaitForChild("Transparency")
local isEquipped = false
local FreddyGUI = script.Parent.Parent.Parent:WaitForChild("Head"):WaitForChild("FreddyGUI")
local IsVisible = false
local Head = script.Parent.Parent.Parent:WaitForChild("Head")
local UserInputService = game:GetService("UserInputService")
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Humanoid = Character:WaitForChild("Humanoid")
UserInputService.InputBegan:Connect(function(Input, gameProcessed)
local KeyCode = Input.KeyCode
if KeyCode == Enum.KeyCode.One then
local goalTransparency
if isEquipped then
isEquipped = false
goalTransparency = 0
else
isEquipped = true
goalTransparency = 1
end
RemoteEvent:FireServer(goalTransparency)
wait(250/1000)
local TTransparency
if IsVisible then
IsVisible = false
TTransparency = 0
else
IsVisible = true
TTransparency = 0.9
end
for _,i in pairs(script.Parent:GetChildren()) do
if (i:IsA("MeshPart") or i:IsA("UnionOperation")) then
i.Transparency = TTransparency
end
end
for _,n in pairs(Character:GetChildren()) do
if (n:IsA("MeshPart") or n:IsA("UnionOperation")) then
n.Transparency = TTransparency
Head.Transparency = TTransparency
Head.face.Transparency = TTransparency
end
end
for i,v in pairs(Character:GetChildren()) do
if (v:IsA("Accessory")) then
v.Handle.Transparency = TTransparency
end
end
end
end)
Server:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Glove = script.Parent
local RemoteEvent = ReplicatedStorage:WaitForChild("Events"):WaitForChild("Transparency")
local Head = script.Parent.Parent.Parent:WaitForChild("Head")
local Ragon = 190198577
local function setTransparency(Player, newTransparency)
for _,i in pairs(script.Parent:GetChildren()) do
if (i:IsA("MeshPart") or i:IsA("UnionOperation")) then
i.Transparency = newTransparency
end
end
for _,n in pairs(script.Parent.Parent.Parent:GetChildren()) do
if (n:IsA("MeshPart") or n:IsA("UnionOperation")) then
n.Transparency = newTransparency
Head.Transparency = newTransparency
Head.face.Transparency = newTransparency
Head.FreddyGUI.TextLabel.TextTransparency = newTransparency
end
end
for i,v in pairs(script.Parent.Parent.Parent:GetChildren()) do
if (v:IsA("Accessory")) then
v.Handle.Transparency = newTransparency
end
end
end
RemoteEvent.OnServerEvent:Connect(setTransparency)
Try using Player.Character instead of the scripts parent.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Glove = script.Parent
local RemoteEvent = ReplicatedStorage:WaitForChild("Events"):WaitForChild("Transparency")
local Head = script.Parent.Parent.Parent:WaitForChild("Head")
local Ragon = 190198577
local function setTransparency(Player, newTransparency)
for _,i in pairs(Player.Character:GetChildren()) do
if (i:IsA("MeshPart") or i:IsA("UnionOperation")) then
i.Transparency = newTransparency
end
end
for _,n in pairs(Player.Character:GetChildren()) do
if (n:IsA("MeshPart") or n:IsA("UnionOperation")) then
n.Transparency = newTransparency
Head.Transparency = newTransparency
Head.face.Transparency = newTransparency
Head.FreddyGUI.TextLabel.TextTransparency = newTransparency
end
end
for i,v in pairs(Player.Character:GetChildren()) do
if (v:IsA("Accessory")) then
v.Handle.Transparency = newTransparency
end
end
end
RemoteEvent.OnServerEvent:Connect(setTransparency)