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

why doesn't my script work?

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

✓ Accepted answer

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)

3 comments

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

0

I copied your script so you made the mistake lol

0

but you gave me the wrong answer so we both made a mistake i think

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