-
So I am trying to make the part appear to a player who placed it and not the other players.
-
The issue is the remote event sends nil? this is the code that fires the remote event.
script.Parent.whatever:FireClient(player,MNEWE,MNEWE:FindFirstChild("Decal"))
- I tried printing it but it printed the part but the localscript prints “nil”
This is the code:
local MNEWE = nil
local tool23 = nil
script.Parent.rage.OnServerEvent:Connect(function(player, mouse, tool2,NEWPART)
print(player,mouse,tool2,NEWPART)
local tool = nil
if tool2 == false then
tool23 = nil
MNEWE = nil
end
if tool23 == nil then
tool23 = Instance.new("Tool", workspace)
tool23.Name = player.Name.. " Building"
local stringvalue = Instance.new("StringValue", tool23)
stringvalue.Value = player.Name
stringvalue.Name = "Owner"
local a = script.yes:Clone()
a.Parent = tool23
a.Enabled = true
if tool == nil then
tool = tool23
end
end
print(tool)
local part = Instance.new("Part", tool23)
part.Anchored = true
part.Size = Vector3.new(1,1,1)
part.CFrame = mouse
if MNEWE == nil then
MNEWE = part
print(MNEWE)
part.Name = "Handle"
MNEWE.Transparency = 1
script.Parent.iwannadie:FireClient(player,MNEWE,true)
script.Decal:Clone().Parent = MNEWE
MNEWE.Decal.Transparency = 1
script.Parent.whatever:FireClient(player,MNEWE,MNEWE:FindFirstChild("Decal"))
else
local weld = Instance.new("WeldConstraint",part)
weld.Part0 = MNEWE
weld.Part1 = part
end
end)
this is the localscript:
script.Parent.whatever.OnClientEvent:Connect(function(part,decal)
print(part,decal)
part.Transparency = 0
decal.Transparency = 0
end)
images:
anyone know how to fix this? thank you if you were helping me.