I would say that, but I do not want to post another while we are actively in here, waste of resources almost.
@Pooglies, I think you should mark the solution, and then we could talk. I also find this topic interesting, but I would like to know who had the best solution and then bombard it with questions .
Alright, I marked a post for solution. Now I am just curious how that guys code works.
LOL, Iām gonna bombard myself with questions.
it is interesting i should try this later on
ok, so first I used the CollectionService to put all the currency into a big group (something like that, I had never used it before) so you donāt have to put a script in every coin, because that would make your game very slow and unplayable, imagine you would have 100 coins per second and you play on a mobile phone. For all Currency (The forloop) in the Workspace i added a Tag.
Have a go:
demo.rbxl (20.8 KB)
Keep in mind all currency parts must be within the āDroppedCurrencyā folder in Workspace.
Play around with some of the values in StarterGui.ScreenGui.LocalScript
until you achieve your desired effect
This is exactly the effect im looking for, but with only 1, I want the effect of tons of the currency going up left, but by only touching 1 block.
i create the RemoteEvent
Get all Currency of the Workspace
Every time the player movesā¦
Check if the Currency is in the Radius. if true then fire to server.
Could you whiten this effect, I am curious to improve my code and experience. A video?
I donāt know what effect it has, but you could use that:
--ServerScript
local CollectionService = game:GetService("CollectionService")
for i,v in pairs(workspace:GetChildren())do
if v.Name == "Currency" then
CollectionService:AddTag(v, "Currency")
end
end
--Script in the TargetPart (!!!1 Part, not more!!!)
local Part = script.Parent
Script.Parent.Touched:Connect(function()
game.ReplicatedStorage.CurrencyRemove:FireServer()
end)
@ee0w , Iām asking you if I can change your script a little, just so I can combine your knowledge with mine.
I donāt want to be a fun-killer, but I did the same thing, didnāt I?
Here
if (HRP.Position - Currency.Position).magnitude =< CollecRadius then --mine
if (hrp.Position - part.Position).Magnitude <= collection_distance then --ee0W
@ee0w, I think your effect is nicer than mine.
I mean to be honest, I wasnāt really sure whos was better, im mainly just trying to figure this out.
Ok, can i help more with something?
I was just curious how I could make it so, instead of having it so once you touch the part, only 1 ticket goes up, if you touch it, multiple tickets go up, making it look like you jsut touched a lot of parts.
local TotalNumberOfGui = math.random(1, 20)
for i = 0, TotalNumberOfGui then
local Gui = Istance.new("Frame", ScreenGui)
Gui.Position = UDim2.fromOffset(Vector.X, Vector.Y) --You should use my script Number2 then there's a position randomizer.
end
What about my Profile gui, you have it set to go upward and left, how would i change it to the player.PlayerGui.Profile.Frame.Cash
Delete local desired_position = UDim2.new(0, 0, 0, 0)
from the LocalScript and replace it with the following:
local pos = game.Players.LocalPlayer:WaitForChild("PlayerGui").Profile.Frame.Cash.AbsolutePosition
local desired_position = UDim2.new(0, pos.x, 0, pos.y)
You already know you can write that, right?
UDim.fromOffset(desired_position.X, desired_position.Y)
or
UDim.fromScale(desired_position.X, desired_position.Y)