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

What's wrong with this script? (Why is it not giving the tool if player has the in-game Tix?)

Hey scriptinghelpers, why isn't my script working? I'm getting the print that says "The user does not have the Tix" when the player indeed does have the Tix. I tried a few different things, I'm not really sure why it's not working. I would really appreciate the help! Thanks in advance and, sorry to bother you with such a simple question. I just can't figure it out.

My code below This is a Script inside of ServerScriptStorage.

local replicatedstorage = game:GetService("ReplicatedStorage")
local tool = replicatedstorage:FindFirstChild("Ghost")

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function(character)
		if player.leaderstats.Tix.Value >= 1000000 then
			tool:Clone().Parent = player:WaitForChild("Backpack")
		else
			print("The user does not have the Tix")
		end
	end)
end)

Thanks again!

1 answer

if your getting the print, then

player.leaderstats.Tix.Value >= 1000000

is false.

Where is

player.leaderstats.Tix.Value

being set such that it's greater than or equal to 1000000?

You should print

player.leaderstats.Tix.Value

before the if statement to see what that value is

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