Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

bad argument #3 to 'Value' (string expected, got Object)?


ParkingGarage = workspace.ParkingGarage function Park(hit) if hit.Name == "ParkingPart" then hit.Parent:GetChildren()

	local CreateGUI = ParkingGarage.SaveName:Clone()
	CreateGUI.Parent = game.Players[game.Players.LocalPlayer.Name].PlayerGui
	CreateGUI.Enabled = true
	CreateGUI.Name = "SaveName"
	repeat
		wait()
	until game.Players[game.Players.LocalPlayer.Name].PlayerGui.SaveName.Clicked.Value == true
	ParkingGarage.CarName.Value = game.Players[game.Players.LocalPlayer.Name]
	ParkingGarage.CarName.Value = ParkingGarage.CarName.Value .. CreateGUI.Jer.Value
	local ModelCreate = Instance.new("Model")
	ModelCreate.Parent = game.Lighting.Parking
	ModelCreate.Name = ParkingGarage.CarName.Value
end

end

ParkingGarage.ParkCarButton.ClickDetector.MouseClick:Connect(Park) ParkingGarage.Sensor.Touched:Connect(Park)


Clear Version: https://ibb.co/NFmKzDt

3 comments

0

what is wrong here

0

i dont understand what this is trying to do, maybe add some backstory next time..?

1 answer

Probably this line:

ParkingGarage.CarName.Value = game.Players[game.Players.LocalPlayer.Name]

It's setting the CarName to the player object.

Are you trying to set it equal to the player's name?

ParkingGarage.CarName.Value = game.Players.LocalPlayer.Name

This discussion is preserved as it was. New answers, comments, and votes are closed.