I am trying to change the face of someone but keep getting the same error:
--Local Script
local player = " "
script.Parent.Activated:Connect(function(player)
player = game.Players.LocalPlayer
local playername = game.Players.LocalPlayer.Name
local image = "https://www.roblox.com/catalog/6288973652/Images-kat9-1"
game.ReplicatedStorage.RemoteEvent:FireServer(player, image)
end)
-- Server Script
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player, image)
-- The line that gets the error:
player.Character.Head.face.Texture = image
end)
Don’t send the player argument from the client, it’s automatically passed to the servers in RemoteEvents and RemoteFunctions as the first argument.
ex.
-- LocalScript
remoteEvent:FireServer()
-- ServerScript
remoteEvent.OnServerEvent:Connect(function(player)
print(player) -- would print the player who fired the event's name
end)
--Local Script
local player = " "
script.Parent.Activated:Connect(function(player)
player = game.Players.LocalPlayer
local playername = game.Players.LocalPlayer.Name
local image = "https://www.roblox.com/catalog/6288973652/Images-kat9-1"
game.ReplicatedStorage.RemoteEvent:FireServer(image)
end)
-- Server Script
game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player, image)
-- The line that gets the error:
player.Character.Head.face.Texture = image
end)