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

How to fix IntValue printing Value?

Hello I was wondering how I could fix my script.

local part = game.Workspace.Generator
local NumBlocks = game.StarterGui.ScreenGui.NumBlocks
local User = NumBlocks.Parent.User
local Rating = NumBlocks.Parent.Rating
local IntValue = game.ReplicatedStorage.Value

while true do
	local LagPart = Instance.new("Part", game.Workspace)
	LagPart.CFrame = LagPart.CFrame * part.CFrame
	LagPart.Transparency = 1
	IntValue.Value = IntValue.Value + 1
	wait(0.1)
	print(IntValue)
end

So when I print it it just prints Value and how many times it has been printed. I want to make it so that it will print a number thank you.

8 comments

0

I dont understand the question here.

0

What do you mean it prints value?

0

So when I run this it prints a string and i want to print a intiger

0

What's the string value that it's printing?

0

it is printing the word Value and this is the name of my IntValue

0

Make sure the actual value object is a int value and not a string value.

0

It is an int

0

Apple check my answer

1 answer

This should fix it. Make sure this is in a local script and in starterplayerscripts :Local script


game:GetService('Players').LocalPlayer:WaitForChild('PlayerGui').ScreenGUI.NumBlocks -- don't use startergui because it only updates once the player isn't in the game.
local User = NumBlocks.Parent.User
local Rating = NumBlocks.Parent.Rating

while true do
    local LagPart = Instance.new("Part", game.Workspace)
    LagPart.CFrame = LagPart.CFrame * part.CFrame
    LagPart.Transparency = 1
    wait(0.1)
end

Script:

local IntValue = Instance.new("IntValue",game.Workspace)
while true do
    IntValue.Value = IntValue.Value + 1
    wait(0.1)
    print(IntValue)
end

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