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

I have an error assigning a value, how can I fix it?

So I'm trying to assign an airport to the player when the enter the game but it isn't working correctly and there is no output, yes there is a connection line, I just didn't feel like posting the rest of the script:

function PlayerEntered(player)
	print(player.Name .. " entered the server")	
	--Stats
	airport = Instance.new("IntValue", player)
	airport.Name = "Airport"
	airport.Value = "None"
	--
	wait()
	--Assigning Airport
-------------------------------This part doesn't execute for some reason?
	for _,v in pairs(game.Workspace.Airports:getChildren()) do
		if airport.Value == "None" then
			if v.Owner.Value == "None" then
				airport.Value = tonumber(string.sub(v.Name,7,8))
				v.Owner.Value = player.Name
			end
		end
	end
-------------------------------
end

1 answer

✓ Accepted answer
airport.Value = "None"

You're attempting to assign a String to an IntValue.

2 comments

0

Wow, I feel stupid now, thanks for catching that.

0

No problem, that's what this site is for.

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