Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Everything else in my script works? But the only problem is you don't lose 100 Throws?

local door = game.Workspace.Door1
local surfacegui = door.SurfaceGui.TextLabel
local plr = game.Players.LocalPlayer
door.Touched:Connect(function(touch)
    if touch.Parent:FindFirstChild("Humanoid") then
        if plr.leaderstats.Throws.Value < 99 then
            print("Player Does Not Have Enough")
            door.Transparency = 0.5
            door.CanCollide = true
            surfacegui.Visible = true
        else
            if plr.leaderstats.Throws.Value >= 99 and not plr:FindFirstChild("doorOpened") then
        local d = Instance.new("IntValue")
        d.Name = "doorOpened"
        d.Parent = plr
                plr.doors.DoorsOpened.Value = plr.doors.DoorsOpened.Value +1
                if plr.doors.DoorsOpened.Value == 1 then
                        door.Transparency = 1
                door.CanCollide = false
				surfacegui.Visible = false
					if plr.leaderstats.Throws.Value == 1 then
						if door.Transparency == 0.5 then
							door.Transparency = 1
							door.CanCollide = false
							surfacegui.Visible = false
							if door.Transparency == 1 then
								plr.leaderstats.Throws.Value = plr.leaderstats.Throws.Value - 100
						end
					end
				end
            end
         end
      end
   end
end)

Why wont the script take away 100 throws?

2 comments

0

any errors you get during runtime?

0

nope

1 answer

I think it's because you set the doors transparency to 1 and then check to see if the doors transparency is 0.5 which it isn't and that's where it subtracts throws by 100.

This discussion is preserved as it was. New answers, comments, and votes are closed.