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