I am making a system that stops a player from placing an item if there is already an object there.
My script is (server script):
local Touching_Parts =clone.Wall:GetTouchingParts()
for _, v in pairs(Touching_Parts) do
if v then
event:FireClient(Player,v)
return
end
end
and my local script (inside player):
game.ReplicatedStorage.TurnObjectRed.OnClientEvent:Connect(function(player,object)
object.Color = Vector3.new(170,0,0)
end)
However,when I try to change the color, it says it is attempting to index nil even though when I print it in the server script, it is not. Why is this happening, and how can I fix it?