I broke a tool and i don't know how to fix

Hello everyone;
So i had a working tool for my simulator game when you clicked you got IQ, but after i put this script into players

local variable IQ
local Character = game.Players.LocalPlayer.Character
Character.Humanoid.HeadScale.Value = 1

if
 IQ = 10 
then set.Humanoid.HeadScale = 3

if
 IQ >11 and iq <20
then set.Humanoid.HeadScale = 3

if
  IQ >19 and iq <30
then set.Humanoid.HeadScale = 17

It broke it, i’m not to sure what happened
here is the tool script;

local module = {}
local replicatedStorage = game:GetService("ReplicatedStorage")

function module.Lift()
	
	replicatedStorage.Remotes.Lift:FireServer()

end

return module

if anyone could help that would be great, thanks
also if anyone knows how the IQ script should be written help please tell me it is the main feature of mmy simulator game.
p.s i can send more info on this if you need

Hello! , Aren’t You forgetting to place the ends after each if statement ( also it would be helpful to included if there were any error in the output for future reference )

This is the error message
image
i put in the end at the end of each statement error still there though

something like this should work a little better:

i’m not sure what your trying to do could you explain a little more? (it would be helpful)

local variable IQ = 0
local Character = game.Players.LocalPlayer.Character
local Humanoid   =  Character:FindFirstChild("Humanoid") 
Humanoid.HeadScale.Value = 1


if Humanoid.HeadScale.Value = 3 then
 IQ = 10 
else if IQ >11 and iq <20

Humanoid.HeadScale.Value = 3

else if   IQ >19 and iq <30 then
Humanoid.HeadScale.Value = 17

   end

 end

end

Thanks for that. but i still need to fix my tool script though any suggestions how to fix it/what’s wrong with it???

Ok so basically in my simulator game i want so when you " read a book" you gain IQ. And what i want is a feature that makes your head larger the more IQ you get (saying your really smart or something) The tool (book) that gives you IQ doesn’t work after i put in the head enlarge script.
(Tool script in original post) @Jaycbee05

I’m pretty sure the issue is with your if statements, but if you are going to have a normal(uniform) ratio for IQ to Head Scale, then save some time and use some math instead of if statements, (im guess you want this in a loop)

so doing something like this would work for changing the head scale in relation to the IQ while the player is reading a book ( you have to define when the player is reading a book)


local IQ= 0 
local Player = game.Players.LocalPlayer
wait(1)
local Character = Player.Character
local BaseIncrement = 1 --- how much you want you want the player to gain size every .1
local  ReadingBook = true
while true do --- l
wait(.1) -- waiting .1 seconds 
     if ReadingBook then
      IQ = IQ + 1
  Character.Humanoid.HeadScale.Value = IQ * BaseIncrement
end

end

Ok so would that replace my current script?

That doesn’t seem to be working

Would you mind providing the full script( in which the problem is occurring ) ( also i updated my previous post)

1 Like

the full tool script???

1 Like

Do you intentionally have two IQ variables? ( ‘IQ’ and ‘iq’ )

If you are trying to check for different levels of IQ, you should be using the same variable, ( Either ‘IQ’ or ‘iq’ )

i’m only using IQ i fixed after original post

Wait, you said “after I put this script into players”. Do you mean you put it into game.Players? Where is it now and where was it before?

I put it into the players tab in the explorer;
image
I made it and put it in there it wasn’t anywhere else before that, i though it was a player script as it changes the head size of the player

I’m not sure what your whole situation/goal is, but this script should probably be placed in either StarterPlayerScripts, or a tool. ( I don’t work with tools so, not sure how they work. ) The code should be inside of a local script, not a regular script. You will need to edit it accordingly. 10 PM

1 Like

I cant test to see if this works unless my tool script is fixed and im not sure how to do that

This should be “if IQ == 10 then..”, not " if IQ = 10 then"

1 Like