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

im makeing a jojo game and my script is not working can i have help figuring it out?

Asked by 4 years ago
Edited 4 years ago

im making a jojo game and i need help im super new to lua and if you could help me figure it out i would be very happy

heres the script

local Arrow = script.Parent local Click = Arrow:WaitForChild("Click")

Click.MouseClick:Connect(function(player)

local Backpack = player:FindFirstChild("Backpack")
if Backpack then
    local Stands = game:GetService("ServerStorage"):WaitForChild("Stands")

    local PlrStats = player:WaitForChild("PlrStats")
    local currentStand = PlrStats:WaitForChild("Stand")


    if PlrStats.Stand.Value ~= "stand1" then
        --Give Stand3
        if Backpack:FindFirstChild("Stand1") or Backpack:FindFirstChild("Stand2") or Backpack:FindFirstChild("Stand3") then
            local prevStand = workspace:FindFirstChild(player.Name.." Stand")
            local prev = Backpack:FindFirstChild("Stand1") or Backpack:FindFirstChild("Stand2") or Backpack:FindFirstChild("Stand3")
            prevStand:Destroy()
            prev:Destroy()

            local Stand = Stands:FindFirstChild("Stand3"):Clone()
            Stand.Parent = Backpack

            currentStand.Value = "Stand3"
        else
            local Stand = Stands:FindFirstChild("Stand3"):Clone()
            Stand.Parent = Backpack

            currentStand.Value = "Stand3"

end

0
Can you explain what you're trying to do with the script? youtubemasterWOW 2741 — 4y
0
im trying to make if i have stand1 i get stand3 if i click it jablesgamer1 2 — 4y

1 answer

Log in to vote
0
Answered by
iuclds 720 Moderation Voter
4 years ago
local Backpack = player:FindFirstChild("Backpack")
if Backpack then
    local Stands = game:GetService("ServerStorage"):WaitForChild("Stands")

    local PlrStats = player:WaitForChild("PlrStats")
    local currentStand = PlrStats:WaitForChild("Stand")


    if PlrStats.Stand.Value ~= "stand1" then
        --Give Stand3
        if Backpack:FindFirstChild("Stand1") or Backpack:FindFirstChild("Stand2") or Backpack:FindFirstChild("Stand3") then
            local prevStand = workspace:FindFirstChild(player.Name.." Stand")
            local prev = Backpack:FindFirstChild("Stand1") or Backpack:FindFirstChild("Stand2") or Backpack:FindFirstChild("Stand3")
            prevStand:Destroy()
            prev:Destroy()

            local Stand = Stands:FindFirstChild("Stand3"):Clone()
            Stand.Parent = Backpack

            currentStand.Value = "Stand3"
        else
            local Stand = Stands:FindFirstChild("Stand3"):Clone()
            Stand.Parent = Backpack

            currentStand.Value = "Stand3"
    end
    end
end
0
mabye jablesgamer1 2 — 4y
0
it did not work jablesgamer1 2 — 4y
0
nvm sorry i works! jablesgamer1 2 — 4y
0
now its saying somthings wrong with local backpack= player jablesgamer1 2 — 4y
Ad

Answer this question