So i’m testing out a function ill need later in my game that changes the player’s character to a character stored in ServerStorage. Unfortunately this doesn’t seem to work… Iv’e already tested out the character itself, which works perfectly fine.
Here is an idea of what i’m trying to do:
local player = game.Players.LocalPlayer
script.Parent.MouseButton1Click:Connect(function(player)
local Monster = game.ServerStorage.Monster:Clone()
Monster.Name = player.Name
player.Character = Monster
Monster.Parent = workspace
end)
As you can see its a very simple script, but when i run it i get an error:
The script is currently a local script, but iv’e also tried this in a script in ServerScriptService, and got the same error.
My bad i got confused for a second and thought you said i can’t use the player variable outside the function in the function realising that the ‘player’ in the brackets was there by mistake.