Not placing tower but there is no errors

No, module’s function is not like normal functions, it needs the name.the function name; thinks modules as a table that stores everything you want.

You need to return this functions. you know?

image_2023-08-08_203543413

This good?

1 Like

module.MouseRaycast = function(exclude)

end

module.AddPlaceholderTower = function(name)

end

module.RemovePlaceholderTower = function()

end

I did that though.

asdasdasdasd

How can I work with Module Scripts? - #3 by remcodesremcodes See this post I made.

good, now let’s sort these functions, I’ve changed my mind on client only for these.

k

asjdokjasdlkasjdlasjdlkjdlkaslkdaslkdjlkasjdlaksjdaslkjdaskdjskaljdlkaskdplas

You can make him a Client Module and then Server Module

Sorry if this is rude but could we go a bit faster? It is 8 at night for me.

2 Likes

no problem

ohmygodthisrobloxiscrazywithmodreation

Let’s start with UpdateGold()
Server

module.UpdateGold = function()
for _, player in pairs(game.Players:GetPlayers()) do
player.PlayerGui.pathtogoldtext.Text = player.Gold.Value
end
end

Done

robloxpleasegetbettermoderation

i’d like to know, do you have towers in rep storage, it’d be easier to clone them

You doing the local script module right?

yes

robloxpleasegetbettermoderation

the module is for both sides

30charrule

Nice, that’s useful then

30 lols

module.AddPlaceholderTower = function(name, player, removetower)
local towertoclone = game.ReplicatedStorage:FindFirstChild(name)
if towertoclone then
if removetower then
removetower:Destroy()
end
local tower = towertoclone:Clone()
--too lazy to write raycast
tower:SetPrimaryPartCFrame(result.Instance.Parent.CFrame)

for _, v in pairs(tower:GetDescendants()) do
if v:IsA("BasePart") then
v.Transparency = 0.3
v.Material = Enum.Material.ForceField
game:GetService("PhysicsService"):SetPartCollisionGroup(v, "Tower")
end
end
end
end

btw im on mobile so it takes a while for me to type

Do you want me to write the raycast? Like copy the code from the raycast script.

Also ok.