#Script mouse click trouble

1 messages · Page 1 of 1 (latest)

zinc lodge
#

local Mouse = game.Players.LocalPlayer:GetMouse()
local charcter = game.Players.LocalPlayer.CharacterAdded:Wait()
local Debounce = false

local function Creation()

local Part = Instance.new("Part")
Part.Shape = Enum.PartType.Ball
Part.Transparency = 0
Part.Size = Vector3.new(0.822, 0.822, 0.822)
Part.Color = Color3.fromRGB(46, 61, 80)
Part.Anchored = true
Part.CanCollide = false
Part.CanTouch = true
Part.CanQuery = false
Part.Parent = workspace.FlingBeam
Part.Material = Enum.Material.SmoothPlastic



local Attachment0 = Instance.new("Attachment", Part)
local Attachment1 = Instance.new("Attachment", charcter)

local beam = Instance.new("Beam", Part)
beam.FaceCamera = true
beam.Attachment0 = Attachment0
beam.Attachment1 = Attachment1
beam.LightEmission = 1
beam.LightInfluence = 0 
beam.TextureMode = Enum.TextureMode.Static
beam.TextureLength = 1.75
beam.TextureSpeed = 0.7
beam.Texture = "rbxassetid://120227639872208"
beam.Parent = Part

Mouse.Button1Down:Connect(function()
    Part.Position = Mouse.Hit.Position
end)

end

Creation()

==========================================================================================================

So please watch the video idk what to do Yall! So basically: When I click I want the Beam and Ball be appear, Then when I click again I want the Ball and beam to dissapear and Repeat ya know. Idk what I did wrong but when I click it dosnt disappear just keeps moving when I click can someone pelase help me!!

uncut moat
#

When do you want it to disappear?

zinc lodge
#

but clicking instead

#

so mabey after I clicked on

#

sorry if I make no sense

lone thunder
#

see the problem???

uncut moat
lone thunder
#

just make a variable to check if the player already clicked

#

bomm

#

ez

uncut moat
#

So make an enabled variable

zinc lodge
#

How plsss

uncut moat
#

And based on that you know when to enqvle/disable it

lone thunder
#
local clicked : boolean = false

local function click()
   clicked = not clicked
      if clicked then
      ...
      else
      ...
   end
end

-- something that runs click
#

this is an example btw

zinc lodge
#

a Boolean

#

@lone thunder @uncut moat What do I say to burn off the beam and Ball?

#

Do I destroy it and re add it

#

when it says else

#

THANK YOUUUUUU

#

I DID IT

uncut moat
zinc lodge
#

@lone thunder @uncut moat New problem!

lone thunder
zinc lodge
#

So I managed to get the click On/Off but when I created the remote Function to make other players see the beam it wont move!!

#

like On/off see in the video its still in one place :c

lone thunder
#

why RemoteFunction?

#

you knwo you couldve just like

zinc lodge
zinc lodge
#

yeahh

#

did you see the video

lone thunder
#

no not yet, im doing something

zinc lodge
#

But I think it has to do with mouse click

#

Imakeep trying

terse skiff
#

wat

zinc lodge
#

and how to make it Move

terse skiff
#

y remote function

zinc lodge
zinc lodge
#

im trying to make a fling system like theirs

#

but I need to connect it to a remote event

#

so I can fling players and they can see my beam

#

cuz it on a LOCAL SCRIPT

terse skiff
zinc lodge
#

AHHHHHHHH

zinc lodge
terse skiff
#

ye i did

#

looks like it works

zinc lodge
#

The issue is

#

When I click the beam doesnt move to where my mouse clicks

#

it just freezes

terse skiff
#

cuz u havent scripted it to do that

#

send mouse pos from client

#

and update it on the server

smoky phoenix
#

making it

#

spawn at that position

zinc lodge
smoky phoenix
#

like bart said

zinc lodge
smoky phoenix
#

you need to actually code it

#

you never did

zinc lodge
#

okay hold up

zinc lodge
#

The part refuses to delete once I clicked it on Client side

#

how to Destroy the part on the server side?

#

@lone thunder @uncut moat @terse skiff

zinc lodge
#

Yall I got it nvm

terse skiff
#

Hi