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

Giving XP for Quest?

local Sword = Instance.new("StringValue",script.Parent) Sword.Value = game.Players.LocalPlayer.NameofSword.Value --------------ADD XP FUNCTION game.Players.LocalPlayer.XP.Value = game.Players.LocalPlayer.XP.Value + 40 game.Players.LocalPlayer.Character[Sword.Value].XP.Value = game.Players.LocalPlayer.Character[Sword.Value].XP.Value + 40 if(game.Players.LocalPlayer.Character[Sword.Value].XP.Value > game.Players.LocalPlayer.Character[Sword.Value].MaxXP.Value)then game.Players.LocalPlayer.Character[Sword.Value].Level.Value = game.Players.LocalPlayer.Character[Sword.Value].XP.Value + 1 game.Players.LocalPlayer.Character[Sword.Value].XP.Value = 0 game.Players.LocalPlayer.Character[Sword.Value].MaxXP.Value = game.Players.LocalPlayer.Character[Sword.Value].MaxXP.Value end game.Players.LocalPlayer.Level.Value = game.Players.LocalPlayer.Character[Sword.Value].Level.Value game.Players.LocalPlayer.XP.Value = game.Players.LocalPlayer.Character[Sword.Value].XP.Value game.Players.LocalPlayer.MaxXP.Value = game.Players.LocalPlayer.Character[Sword.Value].MaxXP.Value

Problem : 22:54:45.165 - SadBlade is not a valid member of Model

1 comment

0

Gah! Code block!

1 answer

Where do you define/explain what/where SadBlade is? SadBlade is basically returning nil because it is not there. You can try to use a FindFirstChild() method or the WaitForChild() event to essentially see/wait for the child to be added.

1 comment

0

Sadblade is the name of ur Katana

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