Hello everyone,
I’m trying to store functions in a server script and I want to call them based on the tool’s type.
I know how to do this in a module script but not sure how to do the same in a normal script
Example:
local Event = RemoteEvent
local function Axe()
--code here
end
local function Pickaxe()
--code here
end
Event.OnServerEvent:Connect(function(player,Type)
-- Let's say for example Type == Pickaxe
Type() -- I want this to call the right function based on the type
end)
If you have any questions feel free to ask