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

Function stops working after one line is completed?

Asked by 6 years ago

This function works up until the line where I wrote "STOPS WORKING" can anybody show me what's wrong with this?


local ReplicatedStorage = game:GetService("ReplicatedStorage") local createPartEvent = ReplicatedStorage.FISHKINDEVENTS:WaitForChild("YellowFish") local function onCreatePartFired(player) wait(2) local coinz = game.ReplicatedStorage.PEOPLE[""..player.Name..""].FISHING.Coins local xpz = game.ReplicatedStorage.PEOPLE[""..player.Name..""].FISHING.XP if player:findFirstChild("leaderstats") then wait(0.1) player.leaderstats.Coins.Value = player.leaderstats.Coins.Value + coinz.Value player.leaderstats.XP.Value = player.leaderstats.XP.Value + xpz.Value --STOPS WORKING HERE player.leaderstats.Fish.Value = player.leaderstats.Fish.Value + 1 end end createPartEvent.OnServerEvent:Connect(onCreatePartFired)
1
change line 13 to player.leaderstats:WaitForChild("Fish").Value = player.leaderstats.Fish.Value +1 and see if that gives you an error you can see Bellyrium 310 — 6y
0
What is the error it gives? arshad145 392 — 6y

Answer this question