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

Sword buy script not working with no error being output?

Asked by
harstud 218 Moderation Voter
4 years ago

It outputs no error, it should be working for my old ROBLOX game but it just doesn't work? The localscript:

script.Parent.MouseButton1Click:Connect(function()
    if game.Players.LocalPlayer.leaderstats.Tix.Value >= 25 then
        print("Sword bought!")
        game.Players.LocalPlayer.leaderstats.Tix.Value = game.Players.LocalPlayer.leaderstats.Tix.Value - 25
        game.ReplicatedStorage.ClassicSword.Archivable = true
        local NewSword = game.ReplicatedStorage.ClassicSword:Clone()
        NewSword.Parent = game.Players.LocalPlayer.Backpack
    end
end)
0
Try using GetService("Players").LocalPlayer instead. It most likely won't change anything, but it's my suggestion. hoyhyo 2 — 4y
0
Oh ok, thank you! harstud 218 — 4y

Answer this question