Range circle issue

Hey!
I’m making a range circle that shows how far it can target anyone. The script:

local CurrentLevel = script.Parent.Parent.CurrentLevel
local Levels = script.Parent.Parent.Levels

script.Parent.Size = Vector3.new(0.1, 0 + Levels[CurrentLevel.Value].Range.Value, 0 + Levels[CurrentLevel.Value].Range.Value)
CurrentLevel:GetPropertyChangedSignal("Value"):Connect(function()
	script.Parent.Size = Vector3.new(0.1, Levels[CurrentLevel.Value].Range.Value,Levels[CurrentLevel].Range.Value)
end)

Um, what’s the issue?
You haven’t stated what is or isn’t happening and what you’ve tried already.

From your description it sounds like you want a visual circle around the player at the targeting radius so they can see which players are inside it.

We can’t see what you’ve assigned the CurrentLevel and Levels variables to, so that’s no help. Are they Parts, GUIs, Decals or some other item?

If you’ve played a TD game before, this will make it easier, it shows how far the tower can hit a enemy. I can’t find a solution if there isn’t one I can think of or find one because it isn’t asked.

The reason I asked is because you gave us almost no information about what you were trying to do. The reason there are a list of items to tell people about when you originally typed this post are so you can pass that information to us so we can help. No information = no help.

  1. What do you want to achieve? Keep it simple and clear!

  2. What is the issue? Include screenshots / videos if possible!

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

Now that you’ve explained it’s for a tower defense game maybe someone can help you out.

You still haven’t answered the questions I asked in my post:

  • What are the CurrentLevel and Levels variables assigned to? Give us a screenshot of your Explorer window showing how the Script parents and children like CurrentLevel and Levels are assigned.

  • What exactly are you using for CurrentValue.Value? A NumberValue, an IntValue, an ObjectValue, etc?

CurrentValue is not used. Where did you see that?

Sorry, CurrentValue.Value.

Nobody here can help you if you don’t supply more information. Please answer all the questions and don’t just focus on one item.

image

They seem self explanatory to me. CurrentLevel is a Int, CurentTaret is a object, Reloading is a non functional bool, and all stats for each level are numbers.

I still haven’t fixed this. The shape of the range circle is a sphere, so it may be to do with that.

Looks fine, I assume you’re just trying to have the range increases as the level increases.

Might be a replication issue, remember to check the console for any errors.

multiply the range value by two. You want the diameter for the range circle not the radius (normally default range value.)

Edit: something like this

CurrentLevel:GetPropertyChangedSignal("Value"):Connect(function()
	script.Parent.Size = Vector3.new(0.1, Levels[CurrentLevel.Value].Range.Value*2,Levels[CurrentLevel].Range.Value*2)
end)
2 Likes