#why my script doesnt error nor works

1 messages · Page 1 of 1 (latest)

sterile folio
whole monolith
#

normalise sending scripts in chat

#

im on phone

sterile folio
#

why my script says Workspace.#########.dAddITEM:16: attempt to index nil with 'Button1Up'

sterile folio
whole monolith
#

Copy +V

sterile folio
# whole monolith Copy +V

wait(.25)
local plr = game.Players:FindFirstChild(script.Parent.Name)
local mouse = plr:GetMouse()
local tool = game.ReplicatedStorage.Boulder
local cooldown = 10
local coolingDown = false
local explodesIn = 7
local char
local mouseCF
script.Parent.MouseInfoRE.OnServerEvent:Connect(function(plr, mouseHit)

    mouseCF = mouseHit

end)

mouse.Button1Up:Connect(function()

    if coolingDown then return end

    coolingDown = true



    wait(0.1)


    local clone = tool:Clone()



    local bv = Instance.new("BodyVelocity")
    bv.Velocity = mouseCF.LookVector * 200
    bv.Parent = clone


    clone.Parent = workspace

    clone.CanCollide = true


    local explodeCoro = coroutine.wrap(function()

        local code = script.Dmg:Clone()
        code.Parent = clone
        tool.Grunt2:Play()
        code.Enabled = true
        wait(explodesIn)

        clone:Destroy()
    end)

    explodeCoro()


    wait(0.1)

    bv:Destroy()


    wait(cooldown - 0.2)

    coolingDown = false
end)
whole monolith
#

also what is ########

#

i cant see it in the script

wet pier
# sterile folio wait(.25) local plr = game.Players:FindFirstChild(script.Parent.Name) local mous...
wait(.25)
local plr = game.Players:FindFirstChild(script.Parent.Name)
local mouse = plr:GetMouse()
local tool = game.ReplicatedStorage.Boulder
local cooldown = 10
local coolingDown = false
local explodesIn = 7
local char
    local mouseCF
    script.Parent.MouseInfoRE.OnServerEvent:Connect(function(plr, mouseHit)

        mouseCF = mouseHit

    end)

    mouse.Button1Up:Connect(function()

        if coolingDown then return end

        coolingDown = true



        wait(0.1)


        local clone = tool:Clone()



        local bv = Instance.new("BodyVelocity")
        bv.Velocity = mouseCF.LookVector * 200
        bv.Parent = clone


        clone.Parent = workspace

        clone.CanCollide = true


        local explodeCoro = coroutine.wrap(function()

            local code = script.Dmg:Clone()
            code.Parent = clone
            tool.Grunt2:Play()
            code.Enabled = true
            wait(explodesIn)

            clone:Destroy()
        end)

        explodeCoro()


        wait(0.1)

        bv:Destroy()


        wait(cooldown - 0.2)

        coolingDown = false
    end)

put 3 ` above & below the message to send it in script format

whole monolith
#

whats button1up

sterile folio
#

let me try

#

nvm it errored

whole monolith
#

is this server or local

#

script

sterile folio
#

there is an remote that sends local

sterile folio
#

there is an local that sends and remote

#

also

whole monolith
#

hm

sterile folio
#

@wet pier it errored

whole monolith
#

show ur locL

#

local script

sterile folio
whole monolith
#

ur using mouse1up

#

in server side?

#

and getmouse only works on client

sterile folio
whole monolith
#

no local tool?

sterile folio
#

wdym

whole monolith
#

no local player?

#

make the serverside script only the bowler

#

then use client

#

to call it

sterile folio
#

Ez

whole monolith
#

ur using local script things in server side

#

like Getmouse()

#

and mousehit is local too

sterile folio
wet pier
hoary night
#

why yall making it so hard

#

the problem is

#

he is getting mouse of the players name

#

not the actual player

#

and it doesnt make sense if u use script.parent when its inside startercharacter

#

cuz u will only return the character and not the actual player

#

if u want to get the player from the character do game.Players:GetPlayerFromCharacter(script.Parent)

#

but when its not inside startcharacter do game.Players.LocalPlayer

#

also

#

you cant access the mouse from server

#

only client

sterile folio
#

why my script doesnt error nor works

#

o

hoary night
#

I aint reading all that shit

#

fire me

sterile folio
#

im gonna poo on u

wet pier
# sterile folio \

you can change it to this

local players = game:GetService("Players")
local plr = players.LocalPlayer
local hrp = script.Parent
while true do
    task.wait(0.01)
    local distance = (plr.Character.HumanoidRootPart.CFrame.Position - hrp.CFrame.Position)
        local blname;
        if distance.Magnitude < 22.5 then
        blname = "Phase One"
        elseif distance.Magnitude < 20 then
        blname = "Phase Two"
        elseif distance.Magnitude < 17.5 then
        blname = "Phase Three"
        elseif distance.Magnitude < 15 then
        blname = "Phase Four"
        elseif distance.Magnitude < 12.5 then
        blname = "Phase Five"
        elseif distance.Magnitude < 10 then
        blname = "Phase Six"
        elseif distance.Magnitude < 7.5 then
        blname = "Phase Seven"
        elseif distance.Magnitude < 5 then
        blname = "Phase Eight"
        end
        if plr.PlayerGui[blname] then
        plr.PlayerGui["Phase One"]:Destroy()
        else
        local block = Instance.new("Message", plr.PlayerGui)
    block.Text = " "
    block.Name = blname
        end
end
#

itll be way shorter

whole monolith
#

why make script so long for no reason

sterile folio
wet pier
#

you have to change it from plr.Character.HumanoidRootPart.Position to plr.Character.HumanoidRootPart.CFrame.Position

#

and hrp.Position to hrp.CFrame.Position

sterile folio
wet pier
# sterile folio still doenst work
local players = game:GetService("Players")
local plr = players.LocalPlayer
local hrp = script.Parent
while true do
    task.wait(0.01)
    local distance = (plr.Character.HumanoidRootPart.Position - hrp.Position)
        local blname;
        if distance.Magnitude < 22.5 then
        blname = "Phase One"
        elseif distance.Magnitude < 20 then
        blname = "Phase Two"
        elseif distance.Magnitude < 17.5 then
        blname = "Phase Three"
        elseif distance.Magnitude < 15 then
        blname = "Phase Four"
        elseif distance.Magnitude < 12.5 then
        blname = "Phase Five"
        elseif distance.Magnitude < 10 then
        blname = "Phase Six"
        elseif distance.Magnitude < 7.5 then
        blname = "Phase Seven"
        elseif distance.Magnitude < 5 then
        blname = "Phase Eight"
        end
        if plr.PlayerGui[blname] then
        plr.PlayerGui[blname]:Destroy()
        else
        local block = Instance.new("Message", plr.PlayerGui)
    block.Text = " "
    block.Name = blname
        end
end
#

what about this

#

OH WAIT

#

nvm

#

what does the error even say

#

and at what line

sterile folio
sterile folio
#

when the player gets at an certain distance, (for example the fartest distance is one) s when the player gets contant at an distant, a message object will cover the screen, if the player gets too close the messages should stack themselves when a player reaches a distance

#

at phase eight there should be 8 message instances on the player gui's