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

Giving XP for Quest?

Asked by 9 years ago

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

0
Gah! Code block! Chronomad 180 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

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.

0
Sadblade is the name of ur Katana DevDeadly3652 0 — 9y
Ad

Answer this question