#Collision group not always working

1 messages · Page 1 of 1 (latest)

paper eagle
#

I used collision groups foe my tycoon so the dropper part can't collide with eachothers. Sometimes when I launch the game with a new datastore, the first dropper start dropping the parts but they stop colliding with the conveyor?!! Anyone knows why? Thanks

hardy crane
#

Can i see the collision groups?

paper eagle
#

oh yeah it's fixed It was a weird probleme due to a union lol

paper eagle
paper eagle
#

how would you do that:

bright axle
#

?

paper eagle
#

since in my game there will be 500+ moving parts, the network would be jammed. So instead, client will run those parts and the server is only so people can't exploit. The server's part will be giving money to the player.

#

The server script is done

#

the client is almost done but I'm stuck there for 2h

#

Icreate the client side part

#

but I need to do something to their cash.Value get upgraded when they touch the upgrader and destroy them when they hit the part collector

paper eagle
bright axle
#

What is the problem?

#

You can use a GetPropertyChanged signal on the leaderstats cash value to update the gui automatically when their cash changes.

paper eagle
paper eagle
#

it has a value as a child

bright axle
#

Give the part an attribute of its value then

paper eagle
#

yes

#

wait let me show you

#

I need to locate the upgrader and poart collector:

#

I'mm so lost

#

okok

paper eagle
#

dropEvent.OnClientEvent:Connect(function(items, spawner, OwnerValue)

local drop = dropperItems:FindFirstChild(items)
local scriptClone = script:FindFirstChild("LocalScript"):Clone()
local cloneGui = billBoardGui:Clone()
local dropClone = drop:Clone()
dropClone.Parent = game.Workspace.Tycoons.DropperParts
dropClone.CollisionGroup = "Drops"

local ownerValue = Instance.new("ObjectValue")
ownerValue.Value = OwnerValue
ownerValue.Parent = dropClone
ownerValue.Name = "OwnerValue"

dropClone:PivotTo(spawner)

local cashValue = Instance.new("IntValue", dropClone)
cashValue.Value = 5
cashValue.Name = "CashValue"


cloneGui.Parent = dropClone
cloneGui.Frame.TextLabel.Text = "$"..cashValue.Value
scriptClone.Parent = dropClone


Debris:AddItem(dropClone, 15)
#

for i, tycoon in pairs(game.Workspace.Tycoons:GetChildren()) do

    if tycoon.Name == "Tycoon" then
        
        if tycoon.Values.OwnerValue == OwnerValue then
            
            local partCollector = tycoon.MainItems.PartCollector
            
            if tycoon.Purchases:FindFirstChild("Upgrader") then
                local upgrader = tycoon.Purchases:FindFirstChild("Upgrader").Upgrader
                
            end
            break
            
            
        end
        
    end
    
    
    
end


partCollector.Touched:Connect(function(hit)
    if hit:FindFirstChild("CashValue") then
        hit:Destroy()
    end
    
end)

end)

#

why isn't it working

#

not destroyibng the part

mystic hareBOT
#

studio** You are now Level 11! **studio

whole summit
#

u gotta do hit.parent which is the character

#

idk what ru tryna do

#

tho

bright axle
bright axle
paper eagle
#

Not a player

paper eagle
bright axle
bright axle
mystic hareBOT
#

studio** You are now Level 13! **studio

bright axle
#
for i, tycoon in pairs(game.Workspace.Tycoons:GetChildren()) do
        if tycoon.Name == "Tycoon" then
            if tycoon.Values.OwnerValue == OwnerValue then
                local partCollector = tycoon.MainItems.PartCollector
                if tycoon.Purchases:FindFirstChild("Upgrader") then
                    local upgrader = tycoon.Purchases:FindFirstChild("Upgrader").Upgrader
                end
                break
            end
        end
    end
    partCollector.Touched:Connect(function(hit)
        if hit:FindFirstChild("CashValue") then
            hit:Destroy()
        end
    end)

Why are you declaring the upgrader variable but never using it?
Another thing is that here "partCollector" won't exist as you declare it within the scope of the loop

paper eagle
#

In serverscript, I find it easy to do, but in local script it's never working

paper eagle
#

Thanks a lot for helping me btw 🫡

#

I changed my script a bit yesturday. Once I get back home I'll show you

bright axle
paper eagle
#

can you send a folder in a remote from server to client?

paper eagle
bright axle
paper eagle
bright axle
paper eagle
#

lmao

#

it's not working

#

ok

paper eagle
# bright axle Not one is better than the other, it depends on your use case

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local Debris = game:GetService("Debris")

local dropEvent = ReplicatedStorage:FindFirstChild("RemoteEvent"):FindFirstChild("SpawnDrop")

local dropperItems = ReplicatedStorage:FindFirstChild("DropperItems")
local billBoardGui = game.ReplicatedStorage:FindFirstChild("BillboardGui")

dropEvent.OnClientEvent:Connect(function(items, spawner, partCollector, upgrader)

local drop = dropperItems:FindFirstChild(items)
local dropClone = drop:Clone()

local scriptClone = script:FindFirstChild("LocalScript"):Clone()

local cloneGui = billBoardGui:Clone()

dropClone.Parent = workspace.Tycoons.DropperParts
dropClone.CollisionGroup = "Drops"
dropClone:PivotTo(spawner)

local cashValue = Instance.new("IntValue", dropClone)
cashValue.Value = 5
cashValue.Name = "CashValue"


cloneGui.Parent = dropClone
cloneGui.Frame.TextLabel.Text = "$"..cashValue.Value
scriptClone.Parent = dropClone


Debris:AddItem(dropClone, 15)

partCollector.Touched:Connect(function(hit)
    if hit == dropClone then
        hit:Destroy()
    end
end)

if upgrader ~= nil then
    upgrader.Touched:Connect(function(hit)
        if hit == dropClone then
            hit:FindFirstChild("CashValue").Value = 2 * hit:FindFirstChild("CashValue").Value
        end
    end)
end

end)

#

this one is working

#

only one thing isn't working

#

thats the child script:
repeat wait() until script.Parent:FindFirstChild("CashValue")
script.Parent:WaitForChild("CashValue").Changed:Connect(function()
script.Parent.BillboardGui.Frame.TextLabel.Text = "$"..script.Parent:WaitForChild("CashValue").Value
end)

#

it's not updating the Text when the cash value change

#

please @bright axle I don't know what's wrong

#

The value really change and the script is in the part

bright axle
#

WaitForChild already yields for u

#

until its found

paper eagle
#

it does not work with that too

paper eagle
#

it's weird since the value geet changed

#

they are both localscript if that can help

bright axle
#

what?