Can't get a string value to update

My Issue:

I’m making a spawner and Im storing some important information for the model such as if its available and who currently spawned in the item. My issue is that when I try to set the string value to the player’s name, it gives me this error:
image

Anyone got any ideas?

Heres my code:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Storage = game:GetService("ServerStorage")

local remoteEvent = ReplicatedStorage:WaitForChild('SpawnBus')

local function SpawnBus(player, Bus)
	local Folder = Storage:WaitForChild('Buses')
	local b = Folder[Bus]:Clone()
	b.Parent = workspace
	ReplicatedStorage.Buses[Bus].Value = player
	ReplicatedStorage.Buses[Bus].IsAvailable.Value = false
end

remoteEvent.OnServerEvent:Connect(SpawnBus)

And yes, when i’ve done

print(player)

It prints out my username, so im not sure what I should do.

2 Likes

Instead of:

ReplicatedStorage.Buses[Bus].Value = player

Try:

ReplicatedStorage.Buses[Bus].Value = player.Name

3 Likes

Thats embarrassing, in my local script, I had

local Player = game.Players.LocalPlayer.Name

So I was thinking it was still like that but completly forgot that it wasnt an argument for the script anyways so thanks for telling me lol!

2 Likes