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

I'm trying to make a Buy Bullet system, how do I get it to work?

Asked by 2 years ago

Server Script:

game.ReplicatedStorage.ChangeBullet.OnServerEvent:Connect(function(plr, bullet)
    if game.ServerStorage.BulletTypes:FindFirstChild(bullet) then
        plr.HiddenStats.BulletType.Value = bullet
    end
end)

Local Script:

local plr = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()
    if not plr.HiddenStats.BulletType.Value == "Default" then
        game.ReplicatedStorage.ChangeBullet:FireServer("Default")
    end
end)

1 answer

Log in to vote
0
Answered by 2 years ago

Found the problem, silly me! I changed the variable bullet so it wasnt the string anymore.

Ad

Answer this question