#Fishing system
32 messages · Page 1 of 1 (latest)
- server main
local UIS = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local hum = char.Humanoid
local mouse = player:GetMouse()
local hold = hum:LoadAnimation(script.Hold)
local cast = hum:LoadAnimation(script.Cast)
local debounce = false
local canReel = false
local reelAmount = 0
local rodName = script.Parent.Name
script.Parent.Events.CheckGood.OnClientEvent:Connect(function()
debounce = true
hum.WalkSpeed = 0
hum.JumpPower = 0
end)
mouse.Button1Down:Connect(function()
if not debounce and char:FindFirstChild(rodName) then
cast:Play()
script.Parent.Events.Cast:FireServer(mouse.Target,mouse.Hit.p)
end
end)
script.Parent.Events.Debounce.OnClientEvent:Connect(function()
hum.WalkSpeed = 16
hum.JumpPower = 50
debounce = false
end)
script.Parent.Events.Reel.OnClientEvent:Connect(function(amount)
canReel = true
reelAmount = amount
end)
UIS.InputBegan:Connect(function(input, process)
if input.KeyCode == Enum.KeyCode.R and not process and canReel == true then
if reelAmount <= 0 then
reelAmount = 0
canReel = false
script.Parent.Events.FinishReel:FireServer()
else
game:GetService("ReplicatedStorage").Events.Update:Fire()
reelAmount -= 1
print(reelAmount)
end
end
end)
script.Parent.Equipped:Connect(function()
hold:Play()
end)
script.Parent.Unequipped:Connect(function()
hold:Stop()
end)
``` - local main
local text = script.Parent
local TS = game:GetService("TweenService")
game:GetService("ReplicatedStorage").Events.ReelGui.OnClientEvent:Connect(function()
TS:Create(text,TweenInfo.new(1),{TextTransparency = 0}):Play()
TS:Create(text.UIStroke,TweenInfo.new(1),{Transparency = 0}):Play()
end)
game:GetService("ReplicatedStorage").Events.ReelGuiEnd.OnClientEvent:Connect(function()
TS:Create(text,TweenInfo.new(1),{TextTransparency = 1}):Play()
TS:Create(text.UIStroke,TweenInfo.new(1),{Transparency = 1}):Play()
end)
game:GetService("ReplicatedStorage").Events.Update.Event:Connect(function()
text.TextColor3 = Color3.fromRGB(255,255,0)
wait(0.1)
text.TextColor3 = Color3.fromRGB(255,255,255)
end)
``` - gui main
the problem is
the fish goes from
1 per cast
too 2 per cast
then 4
and so on
no errors and idk what too do
local fish = {}
local things = game:GetService("ReplicatedStorage").Fish
fish.parts = {
["Trout"] = things.Trout,
["Bass"] = things.Bass,
["Salmon"] = things.Salmon
}
fish.rarities = {
["Trout"] = 60,
["Bass"] = 35,
["Salmon"] = 5
}
fish.prices = {
["Trout"] = 5,
["Bass"] = 15,
["Salmon"] = 50
}
fish.chooseRandomFish = function()
local randomNum = math.random(1,100)
local counter = 0
for fishName, weight in fish.rarities do
counter += weight
if randomNum <= counter then
return fish.parts[fishName]
end
end
end
return fish
``` and heres the module script for fish
nobody cares
dont care i just need help
?
oh ok
so what should i change to make it work
this will work?
ok let me test
yo man your a g thanks sooo much
I am just built different bro