Level System Error

So
Today I just made a level script which works by touching a block
but I wanted to make a level script which works by
using a tool in the starterpack, I tried achieving that by wiring the workspace.thepart to Starterpack.AE
(AE here is a laser gun its just a model I put in to test and not the final model)

game.Players.PlayerAdded:Connect(function(player)
	local level = Instance.new("IntValue", player)
	level.Name = "Level"
	level.Value = 1
	
	local exp = Instance.new("IntValue", level)
	exp.Name = "Current"
	exp.Value = 0
	
	local maxExp = Instance.new("IntValue", level)
	maxExp.Name = "Max"
	maxExp.Value = 100
	
	
	exp.Changed:Connect(function(val)
		if exp.Value >= maxExp.Value then
			-- Do stuff.
			
			level.Value = level.Value + 1
			exp.Value = 0
			maxExp.Value = maxExp.Value * 1.25
		end
	end)
end)

game.Starterpack:WaitForChild("AE").MouseButton1Click:Connect(function(player)
	player.Level.Current.Value = player.Level.Current.Value + 10 -- Use this whenever you want to give the player exp.
end)

the output shows this error

I still dont understand what that means tbh

Its game.StarterPack, you aren’t suppose to connect events to stuff in there, instead put a localscript in the tool, and fire a remote event to the server

1 Like
game.StarterPack:WaitForChild("AE").MouseButton1Click:Connect(function(player)
	player.Level.Current.Value = player.Level.Current.Value + 10 -- Use this whenever you want to give the player exp.
end)

The error shown is on line 28 of the script.

Oh Okay now I get it
now i tried making a localscript and made a remote event to make it and it worked
Thank you
im kinda new to these big scripts so yeah