-
What do you want to achieve? Keep it simple and clear!
Alright so i did an mining script by an youtube tutorial, for some reason i get this error -
What is the issue? Include screenshots / videos if possible!
Here is it - What solutions have you tried so far? Did you look for solutions on the Developer Hub? I looked on youtube, there everything was fine
My code:
local Rock = script.Parent
local SettingsUI = Rock.Settings
local swingsLeft = 15
local function onTouch(otherPart)
local tool = otherPart.Parent
if tool:IsA('Tool') and tool.Mining.Value == true then
swingsLeft -= 1
SettingsUI.Frame.OreName.TextLabel.Text = "Coal Ore ("..swingsLeft.."/15)"
SettingsUI.Frame.HealthFrame.Frame.Frame:TweenSize(UDim2.new(swingsLeft/10,0,1,0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, 1, true)
end
if swingsLeft <= 0 then
Rock:Destroy()
Rock.Parent.Union:Destroy()
end
end
Rock.Touched:Connect(onTouch())