You can write your topic however you want, but you need to answer these questions:
-
What i want to achieve is a shop!
-
Well i have a working script, well not working but… what happens is it fires the clicked event seven times when i only click once, the script isn’t finished i need to make it so you can’t just infinitly click to infinity but it fires the event seven times:
local x = Vector3.new(133.59, 7.185, -180.165)
local y = Vector3.new(133.59, 7.185, -193.539)
local z = x - y
local amn = 5
local truamn = amn - 1
local clicks = 0
print(z)
game.ReplicatedStorage.CameraBuy.OnClientEvent:Connect(function()
local Part = workspace.stonkies
local camera = workspace.CurrentCamera
camera.CameraType = 'Scriptable'
camera.CFrame = Part.CFrame
local player = game.Players.LocalPlayer
player.PlayerGui.GamepassScript.Enabled = false
player.PlayerGui.Backpack.Enabled = false
player.PlayerGui.Arrows.Enabled = true
local arrows = player.PlayerGui.Arrows
arrows["Arrow Left"].ImageButton.MouseButton1Click:Connect(function()
clicks -= 1
local Floored = (math.floor(clicks / 4) + clicks)
Part.Position += Floored * z
camera.CFrame = Part.CFrame
print(clicks)
end)
arrows["Arrow Right"].ImageButton.MouseButton1Click:Connect(function()
clicks += 1
local Floored = (math.floor(clicks / 4) + clicks)
Part.Position += Floored * z
camera.CFrame = Part.CFrame
print(clicks)
end)
end)
- I have no idea what solutions to look for because i haven’t ever seen something like this before
here’s an image of what happens with one click
as you can see it printed clicked 7 times and moved 7 times the normal amount it should, please help
