Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Remote event dosen't fire?

Asked by 4 years ago

So i making this were you can jump on platforms and i wanted to make finish part which should fire event called win in replicated storage once touched but once i touch part i get this error Argument 1 missing or nil and the remote event dosent fire can somone help me.

script.Parent.Touched:Connect(function(hit)

if script.Parent.BrickColor.Name == ("New Yeller") then -- checks what color is part
        game.ReplicatedStorage.Win:FireClient() -- should fire event
        Blur.Size = 20
    end

end)
0
did you want to make the screen blurry? whenever you touch a block? Configuator 158 — 4y

3 answers

Log in to vote
0
Answered by
raid6n 2196 Moderation Voter Community Moderator
4 years ago
Edited 4 years ago

Adding on to@iiMegabyeGaming, You need the player as a first argument for :FireClient to work.

Here's a script.

script.Parent.Touched:Connect(function(hit)
local character = hit.Parent
local player = game.Players:GetPlayerFromCharacter(character)
if script.Parent.BrickColor.Name == ("New Yeller") then -- checks what color is part
        game.ReplicatedStorage.Win:FireClient(player) -- should fire event
        Blur.Size = 20
    end

end)

More information here: https://developer.roblox.com/en-us/api-reference/function/Players/GetPlayerFromCharacter

Ad
Log in to vote
1
Answered by
zadobyte 692 Moderation Voter
4 years ago
Edited 4 years ago

You need the player as a first argument for :FireClient to work. Try using :GetPlayerFromCharacter.

0
Can you write it in script. I understand what you say but i dont know how to write it in script. kristupas12344 26 — 4y
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

if you want to make the screen blurry when you touch a block then do this

insert a BlurEffect inside of lighting then name it Blur. Then change the size to 20 and turn the enabled to false then add a script inside of the part you want to be touched to enable the blur then do this

local Blur = game.Lighting.Blur
script.Parent.Touched:Connect(function(hit)

if script.Parent.Transparency == 0 then
        game.ReplicatedStorage.Win:FireClient() -- should fire event
        Blur.Enabled = true -- enabled the blur
    print("The Screen Is Now Blurry") 
   end
end)

I don't know if this works but you can try it.

0
qould not work raid6n 2196 — 4y

Answer this question