Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

why doesn't my script work?

Asked by
lyxture 27
9 years ago
local player = game.Players.LocalPlayer
local leaderstats = player:WaitForChild('leaderstats')
local level = leaderstats:WaitForChild('level')
local xp = player:WaitForChild('exp')
local experience 


level.Changed:connect(function()
    if xp.Value < 1000 then
        level.Value = 1


if experience.Value == 10
    then game.Workspace.zone["Aomine Daiki"]


end)
end)









game.Players.PlayerAdded:connect(function(plr)
    local stats = Instance.new('IntValue', plr)
    stats.Name = 'leaderstats'

    local experience = Instance.new('IntValue', stats)
    experience.Name = 'EXP'
    experience.Value = 0

    local level = Instance.new('IntValue', stats)
    level.Name = 'level'
    level.Value = 0

    experience.Changed:connect(function()
       level.Value = math.floor(experience.Value / 10)      

    end)
end)

the thing is that the first script that is given is wrong not the second one . i put those 2 in there cause maybe i need to change the second one or something i wanted that IF ANY PLAYER HIS EXPERIENCE VALUE IS EQUAL TO 10 then it would give the item in the game.Workspace.zone.["Aomin Daiki"]

1 answer

Log in to vote
0
Answered by 9 years ago

Im assuming that the item you want to give is called "Aomine Daiki" and it is located in "zone". You missed an end also. I'm still learning so excuse me if this is wrong.

level.Changed:connect(function()
    if xp.Value < 1000 then
        level.Value = 1

if experience.Value == 10 then 

game.Workspace.zone["Aomine Daiki"]:Clone().Parent = plr.Backpack

end
end
end)

0
no sry this is wrong but thank you i think you made the mistake here : if experience.Value == 10 then. i think you need to say wich players experience is eqeul to 10 lyxture 27 — 9y
0
I copied your script so you made the mistake lol ByteInfinity 40 — 9y
0
but you gave me the wrong answer so we both made a mistake i think lyxture 27 — 9y
Ad

Answer this question