You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
Wanna create refuel system for ACS with UI( i did it without UI but i want it to be with ui)
-
What is the issue? Include screenshots / videos if possible!
(It is giving errors with .Parent command too)
(I cant upload UI Cloner script and Other working gas giver without ui)
-
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I did mess with script and nothing happened.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- This is an example Lua code block
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
Add something to your gas script to check something:
-- gas script:
local fuelFill = 50
local db = false
script.Parent.MouseButton1Down:Connect(function(touch) -- I dont think that touch here is an object
print("1")
print(touch, typeof(touch)) -- Check what touch actually is (add this line of code and play your game)
-- The rest of the code, too lazy to copy it...
end)
Expected result: touch is actually the mouse’s x screen coordinate in pixels, not an object.
As i mentioned before i am trying to use a ui

I want it to refill when i click to Fill the Fuel Tank button…
And…
Imma sleep. Feel free to write anything! Thanks for any help
If you look at GuiButton.MouseButton1Down you will see that the first argument returned is
“The mouse’s x screen coordinate in pixels”. This means that if touch.FindFirstChild("Fuel")
on line 6 is actually doing if the mouse's x screen coordinate is Fuel
(This is just the logic of it and as you can see it doesn’t really make much sense.).
@Spiderr12PL Hinted at this by telling you how you could diagnose it but hopefully what I said makes sense if you didn’t understand what they meant.
Thanks. I kinda did it. Now i can give fuel but i dont know how to get user’s name because i just wrote my name
local db= false
function leftClick()
print("Left mouse click")
db = true
workspace["BerkeCavdaroglu's Car"].Fuel.Value=50
db= false
end
script.Parent.MouseButton1Click:Connect(leftClick)
Here’s the solution, This might work since I tested it in studio.
local db= false
function leftClick()
local Player = script.Parent.Parent.Parent.Parent.Parent
print("Left mouse click")
db = true
workspace:FindFirstChild(Player.Name.."'s Car").Fuel.Value=50
db= false
end
script.Parent.MouseButton1Click:Connect
Here’s the code to get the player’s name in a server script.
1 Like
Sorry. I forgot to add workspace:FindFirstChild. And it works now. Thanks!
1 Like
Yeah your welcome, Oh by the way. From the other post you should mark it as a “Solution” lol since its the same as this.
1 Like
I would advise against using
local Player = script.Parent.Parent.Parent.Parent.Parent
This has a strong code smell from it, what happens if tomorrow you add a parent or change anything. You should OnCreation add events or use tags in the CollectionService.