I am working on a healing station where every time you interact with a proximity prompt the billboard frame goes down I have 2 current (NUMBER)values names currentvalue and maxvalue. My current script is,
local frame = game.Workspace.HealingStation.BillboardGui.Green
local currentValue = game.Workspace.HealingStation.Gui
local healthBar = game.Workspace.HealingStation.BillboardGui
local maxValue = game.Workspace.HealingStation.MaxHealth
local Billboard = game.Workspace.HealingStation.BillboardGui
local frame = game.Workspace.HealingStation.BillboardGui.Green
game.Workspace.HealingStation.ProximityPrompt.Triggered:Connect(function(player)
wait(0.1)
game.Workspace.HealingStation.BillboardGui.Green.Size = UDim2.new(0.9, 0, 0, 0)
end)
What type of script is this? Also what do you mean by “not scaling with script”? Does scale not work here, or is the script not changing the size?
This is a server script, I am trying to get X scale to go down every time interacted with proximity prompt but the frame does not load. Basically not changing size
Btw sorry for how I treated u last time on the DevForum. It was m first time posting and I was not reading the problem right.
Try frame.Size * 0.9
or frame.Size - 0.1
. instead of the lone 0.9
you have.
Not a problem.
1 Like
this error prints in the output,
Workspace.HealingStation.Script:10: invalid argument #2 (UDim2 expected, got number)
Properties of the health station i’m designing
Is that your whole script? Also try this, less line clutter.
local HealingStation = workspace.HealingStation
local currentValue = HealingStation.Gui
local healthBar = HealingStation.BillboardGui
local maxValue = HealingStation.MaxHealth
local frame = healthBar.Green
HealingStation.ProximityPrompt.Triggered:Connect(function(player)
wait(0.1)
frame.Size = UDim2.new(frame.Size.X.Scale - 0.1, 0, 0, 0)
end)
I have a second script in the proximity prompt and this is it,
script.Parent.Triggered:Connect(function(player)
game.Workspace.HealingStation.Gui.Value -= 0.1
player.Character.Humanoid.Health = player.Character.Humanoid.Health + 10
game.Workspace.HealingStation.CurrentValue.Value -= 1
if game.Workspace.HealingStation.CurrentValue.Value < 0 then
game.Workspace.HealingStation.ProximityPrompt:Destroy()
end
end)
Yeah, try this, see what it outputs, so I can count the lines easier.
Workspace.HealingStation.Script:9: invalid argument #2 (UDim2 expected, got number)
same thing I think?
Found error, we did -0.1
, but it should’ve been - 0.1
.
so should this be the new script?
local HealingStation = workspace.HealingStation
local currentValue = HealingStation.Gui
local healthBar = HealingStation.BillboardGui
local maxValue = HealingStation.MaxHealth
local frame = healthBar.Green
HealingStation.ProximityPrompt.Triggered:Connect(function(player)
wait(0.1)
frame.Size = UDim2.new(frame.Size - 0.1, 0, 0, 0)
end)
alright ill try it and ill let you know if any errors come up
idk man for some reason I keep getting this error.
Workspace.HealingStation.Script:9: invalid argument #2 (UDim2 expected, got number)
Another error found. Should be frame.Size.X.Scale - 0.1
.
so should I change it to this?
frame.Size = UDim2.new(frame.Size.X.Scale - 0.1, 0, 0, 0)